This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在ti\c2000\C2000Ware_DigitalPower_SDK_3_02_00_00\solutions\tidm_02008
中有一个"ttplpfc_nonpowerSUITE_F28004x"的工程
该工程的"ttplpfc.h"这里有一段
#ifndef __TMS320C28XX_CLA__ #include <math.h> #else #include <CLAmath.h> #endif
可以看到#include <CLAmath.h>是没有启用的,直接宏定义是不行的
我很奇怪,为什么写了这一段但是调用出错了,找了很多CLA的资料都说只要在编译器设置中找到CLA相关的选项启动就可以了,但试了很久都没有成功
想知道是要在什么位置定义"__TMS320C28XX_CLA__",
还是说编译器要设置什么才能启用这部分内容
你可以看一下编译器的说明:https://www.ti.com/lit/ug/spru514w/spru514w.pdf
按照说明,只要编译.cla的文件,__TMS320C28XX_CLA__就会被定义为1
看一下说明:Defined to 1 if any --cla_support option was used and the source file is a .cla file.
这里我觉得应该很清楚了,只要编译.cla的文件,__TMS320C28XX_CLA__就会被定义为1,__TMS320C28XX_CLA__被定义为1就会执行include <math.h>而不会include <clamath.h>
他写的是
#ifndef __TMS320C28XX_CLA__ //如果没有定义_TMS320C28XX_CLA__ #include <math.h> //没有定义_TMS320C28XX_CLA__则引用#include <math.h> #else //否则有定义_TMS320C28XX_CLA__ #include <CLAmath.h> //有定义_TMS320C28XX_CLA__则引用#include <CLAmath.h> #endif
您又说只要编译了.cla那它就会被定义为1,那它被定义为1了不应该引用<CLAmath.h>嘛?
它写的是"#ifndef"喔,如果没定义,您是不是看错了。。。
抱歉抱歉,确实看错了。。。
我后来去咨询了一下美国那边的工程师,他们的回复是:当头文件被 CLA 源文件包含时,CLAmath.h 将被包含在内。 当 C28 端包含相同的头文件时,将包含 math.h。
也就是说,是因为“ttplpfc.h”这个头文件还被"ttplpfc.c"这些C28端的文件引用了才会导致最后引用了<math.h>而不是<CLAmath.h>?
那也有问题啊,我重新创一个头文件“text.h”被"ttplpfc_clatask.cla"引用还是不行啊
我还是理解错了?