赞
踩
在keil中需添加这两个宏

一、宏USE_STDPERIPH_DRIVER
1.这个宏控制了是否在应用中启动外设驱动。
2.在函数Stm32f10x.h中(在keil中设置后无需在此处开启)
#if !defined 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
#ifdef USE_STDPERIPH_DRIVER
#include "stm32f10x_conf.h"
#endif
==》决定了是否用stm32f10x_conf.h,此头文件中包含了各种外设的头文件,以及用于调试的assert_param函数和assert_failed函数(assert_failed 自定义--发生错误时执行的操作&#x
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。