TI中文支持网
TI专业的中文技术问题搜集分享网站

Semaphore_Handle 编译错误

Hi,

我在制作自己的lib库时,用到SYSBIOS信号量,(我用的BIOS6),写如下代码:

Semaphore_Handle write_sem;

write_sem = Semaphore_create(1,NULL,NULL);

 

但是会提示“ identifier "Semaphore_Handle" is undefined”错误。

我在头文件中已经添加了“#include <ti/sysbios/knl/Semaphore.h>”;在工程右击的Properties下的Include options 下也添加了

"C:\Program Files\Texas Instruments\bios_6_32_04_49\packages"这个路径,用于确保头文件位置。

 

如果我添加“#include <ti/sysbios/ipc/Semaphore.h>”,就不会有上述这个错误,ipc下和knl的代码规格一致,路径都在

        C:\Program Files\Texas Instruments\bios_6_32_04_49\packages,其他文件未变。

 

打开ti/sysbios/knl/Semaphore.h,文件里有“#define Semaphore_Handle ti_sysbios_knl_Semaphore_Handle”,说明这个

Semaphore_Handle已经定义,但是怎么编译的时候还是会有错误?

用ipc的头文件虽然可以正确编译库,但是在自己的sysbios工程里用编译好的库时,因为不是ipc所以错误一大堆,

而且不符合sysbios工程。

请问高手,还需要注意什么呢?

万分感谢。

 

Andy Yin1:

您好,

在cfg文件中加入var Semaphore = xdc.useModule('ti.sysbios.ipc.Semaphore'); 试试看

赞(0)
未经允许不得转载:TI中文支持网 » Semaphore_Handle 编译错误
分享到: 更多 (0)