//***************************************************************************** // // Prototype for the function that is called when an invalid argument is passed // to an API. This is only used when doing a DEBUG build. // //***************************************************************************** extern void __error__(char *pcFilename, unsigned long ulLine);
//***************************************************************************** // // The ASSERT macro, which does the actual assertion checking. Typically, this // will be for procedure arguments. // //***************************************************************************** #ifdef DEBUG #define ASSERT(expr) { if(!(expr)) { __error__(__FILE__, __LINE__); } } #else #define ASSERT(expr) #endif
函数原型在StellarisWare_for_EK-LM3S811driverlibdebug.h
#ifndef __DEBUG_H__
#define __DEBUG_H__
//*****************************************************************************
//
// Prototype for the function that is called when an invalid argument is passed
// to an API. This is only used when doing a DEBUG build.
//
//*****************************************************************************
extern void __error__(char *pcFilename, unsigned long ulLine);
//*****************************************************************************
//
// The ASSERT macro, which does the actual assertion checking. Typically, this
// will be for procedure arguments.
//
//*****************************************************************************
#ifdef DEBUG
#define ASSERT(expr) {
if(!(expr))
{
__error__(__FILE__, __LINE__);
}
}
#else
#define ASSERT(expr)
#endif
#endif // __DEBUG_H__
#define ASSERT(expr) {
if(!(expr))
{
__error__(__FILE__, __LINE__);
}
}
#else
#define ASSERT(expr)
#endif
这些是什么意思,好想汇编指令定义总中断那样。不理解__error__(__FILE__, __LINE__); 是什么意思,为什么要加(斜杠)呢?我在SD卡的试验程序的宏定义上也见了使用(斜杠)。不用不是也可以?
一周热门 更多>