assert_param 错误的解决方法
来源:互联网 发布:sap创建物料主数据 编辑:程序博客网 时间:2024/06/08 18:13
方1:在MDK和IAR上使用stm32的3.0库建立一个新工程的时候,发现会发出warning: #223-D: function "assert_param" declared implicitly的警告。
解决方法很简单,MDK的在工程上点右键,选择options,选择C/C++选项,在defined的框里填上 USE_STDPERIPH_DRIVER就可以了。 方2
在user\stm32f10x.h中添加如下宏定义:
#if !defined USE_STDPERIPH_DRIVER //这句为系统自带的
#define USE_STDPERIPH_DRIVER 1 //添加此句 或者:
#define USE_STDPERIPH_DRIVER //添加此句 /**
* @brief Comment the line below if you will not use the peripherals drivers. In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */
/*#define USE_STDPERIPH_DRIVER*/ #endif //这句为系统自带的
如何使用assert_param
2010-02-02 21:57:40
如何使用assert_param
在STM32的固件库和提供的例程中,到处都可以见到assert_param()的使用。如果打开任何一个例程中的stm32f10x_conf.h文件,就可以看到实际上assert_param是一个宏定义;在固件库中,它的作用就是检测传递给函数的参数是否是有效的参数。
所谓有效的参数是指满足规定范围的参数,比如某个参数的取值范围只能是小于3的正整数,如果给出的参数大于3,则这个assert_param()可以在运行的程序调用到这个函数时报告错误,使程序员可以及时发现错误,而不必等到程序运行结果的错误而大费周折。
解决方法很简单,MDK的在工程上点右键,选择options,选择C/C++选项,在defined的框里填上 USE_STDPERIPH_DRIVER就可以了。 方2
在user\stm32f10x.h中添加如下宏定义:
#if !defined USE_STDPERIPH_DRIVER //这句为系统自带的
#define USE_STDPERIPH_DRIVER 1 //添加此句 或者:
#define USE_STDPERIPH_DRIVER //添加此句 /**
* @brief Comment the line below if you will not use the peripherals drivers. In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */
/*#define USE_STDPERIPH_DRIVER*/ #endif //这句为系统自带的
如何使用assert_param
2010-02-02 21:57:40
如何使用assert_param
在STM32的固件库和提供的例程中,到处都可以见到assert_param()的使用。如果打开任何一个例程中的stm32f10x_conf.h文件,就可以看到实际上assert_param是一个宏定义;在固件库中,它的作用就是检测传递给函数的参数是否是有效的参数。
所谓有效的参数是指满足规定范围的参数,比如某个参数的取值范围只能是小于3的正整数,如果给出的参数大于3,则这个assert_param()可以在运行的程序调用到这个函数时报告错误,使程序员可以及时发现错误,而不必等到程序运行结果的错误而大费周折。
阅读全文
0 0
- assert_param 错误的解决方法
- assert_param函数的意义
- assert_param()的使用
- assert_param的使用
- assert_param的应用
- assert_param的应用
- assert_param()的使用
- assert_param()
- STM32中assert_param的使用
- STM32中assert_param的使用
- STM32中assert_param的使用
- STM32中assert_param的使用
- STM32中assert_param的使用
- stm32中assert_param()的作用
- STM32中assert_param的使用
- STM32中assert_param的使用
- STM32中assert_param的使用
- STM32中assert_param的使用
- JAVA学习笔记_使用Servlet3.0上传图片,无法使用part.getSubmittedFileName()方法解决
- 办法总比困难多--JMeter压测小记
- ubuntu14.04安装mininet和floodlight
- Python变量赋值的秘密
- Refused to execute script from '....js' because its MIME type ('text/html') is not executable...
- assert_param 错误的解决方法
- Linux开启Lockdep检测内核死锁
- 计算机编码
- Matlab实现svm的分类
- 相对定位与绝对定位
- mysql 优化语句
- 引用作为函数返回值
- Java基础(六)----注释 annotation
- Shell特殊变量大全: $0, $#, $*, $@, $?, $$,$!,$- 简介.$@ $*对比详解 -- shell学习