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.

[参考译文] 编译器/TMS320F28.0049万M:使用16.9 时在F28.0049万 CLA中使用HRPWM的警告.................3.

Guru**** 2531230 points


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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/662755/compiler-tms320f280049m-warning-for-using-hrpwm-in-f280049-cla-while-using-lts16-9-3

部件号:TMS320F28.0049万M
主题中讨论的其他部件:TMS320F28.0049万

工具/软件:TI C/C++编译器

大家好,

 我的客户在使用TMS320F28.0049万 CLA使用HRPWM:使用“#define” 定义常量地址中的变量时,以及在使用“=” 操作 为变量提供值时,报告了一则警告,并报告了“#173-D无效类型转换”。   已尝试float32 和Int32变量 类型,警告仍然存在。  xx.CLA文件中的源代码。

  下图显示了详细信息, 您是否可以评论如何删除此警告? 期待您的回复,谢谢。

此致

本杰明

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

    在CLA上,常量0x4052的类型是32位(与int相同),指针的类型是16位。  因此会进行缩小转换,编译器会就此发出警告。  您可以通过将#define更改为此...来避免警告。

    #include <stdint.h>// for uintpttr_t
    #define DBFEDHM1 (*(volatile unsigned long *)(((uintpttr_t) 0x4052))
    

    stdin.h中的类型uintpttr_t是与指针宽度相同的无符号整数类型。  在CLA上,这是无符号短整型。

    谢谢,此致,

    -George