论坛大神
  
- 积分
- 2196
- 金钱
- 2196
- 注册时间
- 2012-2-8
- 在线时间
- 35 小时
|
发表于 2012-3-14 12:15:32
|
显示全部楼层
回复【楼主位】trochili:
---------------------------------
你去网上搜,
这个和调试状态和非调试状态有关,
在stm32f10x_conf.h里面有段代码,就是用来控制assert_param的编译的,
另外,如果用了3.5的库,就不要用MDK默认给的那个头文件了,会出问题的
如果定义了 USE_FULL_ASSERT, 就需要你提供那个assert_param函数,
如果没有,assert_param等效为空语句。
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function which reports
* the name of the source file and the source line number of the call
* that failed. If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0: assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */
|
|