11718|3

82

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

assert_failed作用 [复制链接]

请问
void assert_failed(u8* file, u32 line)
是什么作用啊 我没太理解数据手册上说的
在什么地方应用呢
此帖出自stm32/stm8论坛

最新回复

                                 固件库的每一个例程中都有一个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)   {   } } 看看这个说明应该就能明白了。  详情 回复 发表于 2010-1-26 13:26
点赞 关注
 

回复
举报

83

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
                                 你看的哪个数据手册上有说明这个assert_failed()?
此帖出自stm32/stm8论坛
 
 

回复

79

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
                                 固件库文件
此帖出自stm32/stm8论坛
 
 

回复

68

帖子

0

TA的资源

一粒金砂(初级)

4
 
固件库的每一个例程中都有一个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)
  {
  }
}


看看这个说明应该就能明白了。
此帖出自stm32/stm8论坛
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/6 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表