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.

[参考译文] CCSTUDIO-THEIA:F28P65x:将器件支持(位字段)集成到基于 SysConfig 的 DriverLib 工程时出现编译错误

Guru**** 2875980 points

Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1629262/ccstudio-theia-f28p65x-compilation-errors-when-integrating-device-support-bit-fields-into-a-sysconfig-based-driverlib-project

部件号:CCSTUDIO-THEIA
Thread 中讨论的其他器件: C2000WARESysConfig

您好:

我正在使用 F28P65x C2000Ware 6.00.01.00 。 我要使用 器件支持(位字段) 中的接头 基于 SysConfig 的 DriverLib 工程 为性能关键型任务执行直接寄存器访问。

1.基础项目: 我使用以下示例作为起点: C:\ti\c2000\C2000Ware_6_00_01_00\driverlib\f28p65x\examples\c28x_dual\led_ex2_blinky_sysconfig_cpu1

2.启用设备支持的步骤: 若要启用位域结构、我执行了以下步骤并引用了led_ex1_blinky(非 SysConfig)示例:

  • 工程属性>常规>变量: 添加了以下路径:

    • C2000WARE_COMMON_INCLUDE${COM_TI_C2000WARE_INSTALL_DIR}/device_support/f28p65x/common/include/

    • C2000WARE_HEADERS_INCLUDE${COM_TI_C2000WARE_INSTALL_DIR}/device_support/f28p65x/headers/include/

  • “Project Properties“>"Build">"C2000 Compiler">"Include“ Compiler">"Include Options"“ Options":“:</s>“ ““添加了${C2000WARE_COMMON_INCLUDE}${C2000WARE_HEADERS_INCLUDE}

  • 文件迁移: 将以下文件复制到我的项目文件夹(与相同级别)main.c

    • f28p65x_headers_nonBIOS_cpu1.cmd

    • f28p65x_globalvariabledefs.c

  • 代码修改 (main.c):

    • 添加了 #include "f28p65x_device.h"

    • 添加了测试线: GpioDataRegs.GPADAT.bit.GPIO1 = 1;

3、遇到错误: 在编译期间、我收到以下与标头冲突相关的错误:

明文
"C:\ti\c2000\C2000Ware_6_00_01_00\device_support\f28p65x\headers\include\f28p65x_lin.h", line 238: error #41: expected an identifier
"C:\ti\c2000\C2000Ware_6_00_01_00\device_support\f28p65x\headers\include\f28p65x_lin.h", line 238: error #80: expected a type specifier
"C:\ti\c2000\C2000Ware_6_00_01_00\device_support\f28p65x\headers\include\f28p65x_lin.h", line 238: error #170: a function type is not allowed here
"C:\ti\c2000\C2000Ware_6_00_01_00\device_support\f28p65x\common\include\f28p65x_globalprototypes.h", line 136: error #41: expected an identifier
"C:\ti\c2000\C2000Ware_6_00_01_00\device_support\f28p65x\common\include\f28p65x_globalprototypes.h", line 136: error #91: function returning function is not allowed

这似乎f28p65x_device.h与 DriverLib / SysConfig 环境(或其依赖项)冲突。

4、问题: 由于我的应用包含对性能敏感的代码、因此必须将直接寄存器访问(位字段)与 DriverLib 一同使用。 在支持 SysConfig 的 F28P65x 工程中混用器件支持和 DriverLib 时、建议使用什么方法来解决这些标头冲突?

此致、

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、  

    如果在工程中同时使用 bitfield 标头和 driverlib、则需要添加预定义的符号“_dual_headers"来“来解决这些编译错误。

    此致

    Siddharth