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.

[参考译文] TMS320F28379D:不兼容的 true/false 声明;true/false 声明

Guru**** 2523990 points
Other Parts Discussed in Thread: C2000WARE

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1384188/tms320f28379d-incompatible-declarations-of-true-false-true-false

器件型号:TMS320F28379D
Thread 中讨论的其他器件:C2000WARE

工具与软件:

在  C2000Ware_5_02_00_00/libraries/flash_api/f2837xd/include/types.h 中、将条件声明为 false 和 true:

#if FALSE != 0
#define false FALSE
#endif
#if TRUE != 1
#define true TRUE
#endif
 

在  C2000Ware_5_02_00_00/driverlib/f2837xd/driverlib/inc/hw_types.h 中、true 和 false 定义如下:

/* To fix Misra-C errors */
#ifndef TRUE
#define TRUE  ((bool) 1)
#endif
#ifndef FALSE
#define FALSE ((bool) 0)
#endif

在扩展上述代码时、这会导致以下编译器错误:

"/Applications/ti/c2000/C2000Ware_5_02_00_00/libraries/flash_api/f2837xd/include/Types.h", line 129: error #18: expected a ")"
"/Applications/ti/c2000/C2000Ware_5_02_00_00/libraries/flash_api/f2837xd/include/Types.h", line 132: error #18: expected a ")"

这可通过以下源文件重现:

#include <driverlib.h>
#include <Types.h>

编译时使用:

cl2000 --compile_only --c_file=flash_driver.c -DHAS_DRIVER_LIB -D_FLASH -D_LAUNCHXL_F28379D --include_path=/Applications/ti/c2000/C2000Ware_5_02_00_00/libraries/flash_api/f2837xd/include --include_path=/Applications/ti/c2000/C2000Ware_5_02_00_00/device_support/f2837xd/common/include --include_path=/Applications/ti/c2000/C2000Ware_5_02_00_00/device_support/f2837xd/headers/include --include_path=/Applications/ti/c2000/C2000Ware_5_02_00_00/driverlib/f2837xd/driverlib --include_path=/Applications/ti/ti-cgt-c2000_22.6.0.LTS/include --silicon_version=28 --large_memory_model --unified_memory --cla_support=cla1 --float_support=fpu32 --fp_mode=relaxed --tmu_support=tmu0 --vcu_support=vcu2 --display_error_number --symdebug:dwarf --c99 --gen_func_subsections --gen_data_subsections=on --opt_level=4 -DNASSERT --output_file=flash_driver.c.obj

是否有任何理由不在单个翻译单元中包含`driverlib.h`和`types.h`?

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

    尊敬的 Torsten:

    我们受到飓风的影响,没有电力/互联网。

    我们的回复可能会延迟。

    谢谢。此致、

    Vamsi

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

    祝大家好运。 保持安全!  

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

    尊敬的 Torsten:

    我通知 SW 团队检查是否存在任何常见定义、并进行适当的更改以避免错误。

    谢谢。此致、
    Vamsi

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

    谢谢! 顺便说一下、一个简单的权变措施是按相反的顺序包含接头。

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

    谢谢 Torsten 将对其进行分析。

    此致、

    Rajeshwary