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.

[参考译文] TMS320F28377D:如何解决形成开关主体的语句发出警告(MISRA-C:2004 14.8/R),而执行... while 或 for 语句应为复合语句

Guru**** 2522800 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/952198/tms320f28377d-how-to-solve-warning-stating-misra-c-2004-14-8-r-the-statement-forming-the-body-of-a-switch-while-do-while-or-for-statement-shall-be-a-compound-statement

器件型号:TMS320F28377D

我正在处理 MISRA C:2004合规性问题、并收到警告  

#1469-D (MISRA-C:2004 14.8/R)构成开关主体的语句,while,do ... while 或 for 语句应为无限 循环 ILLEGAL_ISR 的复合语句

中断空 ILLEGAL_ISR (空)

/*在此处插入 ISR 代码*/

/*接下来的两行仅用于调试以在此处停止处理器*/
/*插入 ISR 代码后删除*/
asm (" ESTOP0");

适用于(;);

如果有人能帮助解决这一问题,那将不胜感激。

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

    您好,  

    我认为警告是针对“ILLEGAL_ISR”中的无限循环语句。  

    您必须添加 ISR 代码来处理中断并删除最后两行代码。

    此致

    Siddharth