assert_failed 作用

[复制链接]
6211|3
 楼主| dlwlmlj 发表于 2010-1-26 12:14 | 显示全部楼层 |阅读模式
请问
void assert_failed(u8* file, u32 line)
是什么作用啊 我没太理解数据手册上说的
在什么地方应用呢
香水城 发表于 2010-1-26 12:23 | 显示全部楼层
你看的哪个数据手册上有说明这个assert_failed()?
 楼主| dlwlmlj 发表于 2010-1-26 12:53 | 显示全部楼层
固件库文件
香水城 发表于 2010-1-26 13:26 | 显示全部楼层
固件库的每一个例程中都有一个main.c,在每个main.c中都有这个函数的实现和说明:

/**
  * @brief  Reports the name of the source file and the source line number
  *   where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t* file, uint32_t line)
{
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {
  }
}


看看这个说明应该就能明白了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

46

主题

436

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部