在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 自定义--发生错误时执行的操作,用于调试,但此会影响stm32运行,调试结束后,不可在用)
二、宏STM32F10X_HD
在stm32f10x.h中
#if !d