DEBUG这个宏定义何时会生效?是否有相关文档说明
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.
没看到专门的文档说明,个人感觉主要影响driverlib等库的调试。driverlib的库函数有大量使用ASSERT来判断输入合法性,定义DEBUG后ASSERT在检测到错误输入时会报错。
//*****************************************************************************
//
// The ASSERT macro, which does the actual assertion checking. Typically, this
// will be for procedure arguments.
//
//*****************************************************************************
#ifdef DEBUG
#ifdef __TMS320C28XX__
//
// When called from C28x application
//
#define ASSERT(expr) do \
{ \
if(!(expr)) \
{ \
__error__(__FILE__, __LINE__); \
} \
} \
while((_Bool)0)
#else
//
// When called from CLA application. Update as needed.
//
#define ASSERT(expr) do \
{ \
if(!(expr)) \
{ \
__mdebugstop(); \
} \
} \
while((_Bool)0)
#endif
#else
#define ASSERT(expr)
#endif