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.

关于#define PACKED __attribute__ ((packed))

Other Parts Discussed in Thread: HALCOGEN

硬件RM48 HDK

开发环境为CCS5.5

编译器版本TI V5.1.5

编译设置都为默认值

Holcogen生成的usblib.h 中的预编译语句#define PACKED __attribute__ ((packed)) 无法通过编译

导致如下结构体定义:

typedef struct

{

}PACKED tUSBRequest;

编译报错:error #80: expected a type specifier

           error #258: invalid redeclaration of type name "__attribute__" 

           error #66: expected a ";"

请问还需要做什么特别的设置吗?谢谢!

  • Hi Yanfang,

      关于USB模块的设置,我们有一个专门的网页介绍,你可以参考一下:

    http://processors.wiki.ti.com/index.php/HALCoGen_USB_Device_-_driver_&_CDC_Class

    谢谢

    ken

  • ken,谢谢!我说的是关于编译的设置,已经找到答案了,在Advanced Option->Language Option里选择支持GCC后编译就没错了。

    以下是关于USB的问题:

    需要的是host功能,按照您给的网友操作,将device选择改为host,但不知为何生成的还是USB device相关的文件,不知您这边有无usb host的例程?