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.

[参考译文] TMS320F28386S:如何防止发布时生效?

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1230242/tms320f28386s-how-to-prevent-assert-in-release

器件型号:TMS320F28386S

你好。

我已经注意到、在某些情况下、代码会停止。

通过一些测试、它 会在未连接调试器时接缝如 assert 一样。

那么、如果这为真、我如何在版本构建中禁用停止代码的断言?

太棒了!

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

    我在断言定义中发现了这一点...

    #ifdef 调试
    #define assert(expr)执行\
    {\
    if (!(expr))\
    {\
    __error__(__file__,__line__);\
    }\
    }\
    while (0)
    #else
    #define assert(expr )
    #endif