STM32 --- 断言(assert_param)的开启和使用

默认,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);
原文地址:https://www.cnblogs.com/god-of-death/p/9195425.html