打印

assert_failed 作用

[复制链接]
4758|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

粉丝