god-of-death

默认,STM32的assert_param是没有开启检测,需要 #define USE_FULL_ASSERT

 

开启后,才能检测形参是否符合要求

 

// #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
#define assert_param( x ) if( x == 0 ) { for(;;); }
/* Exported functions ------------------------------------------------------- */
// void assert_failed(uint8_t* file, uint32_t line);

 

分类:

技术点:

相关文章: