外设宏定义USE_STDPERIPH_DRIVER
#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
如果不适用片内外设,则不要取消 /*#define USE_STDPERIPH_DRIVER*/的注释
注意stm32f10x.h文件的最后有这样的代码:
#ifdef USE_STDPERIPH_DRIVER
#include "stm32f10x_conf.h"
#endif
stm32f10x_conf.h中包含了所有外设的头文件,因此任意源文件只要包含了stm32f10x.h,就可以在源文件调用任意外设的函数。
若有外设为使用到,在stm32f10x_conf.h注释相应部分,项目编译时就不会在编译去掉的外设。
外设宏定义USE_STDPERIPH_DRIVER
#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
如果不适用片内外设,则不要取消 /*#define USE_STDPERIPH_DRIVER*/的注释
注意stm32f10x.h文件的最后有这样的代码:
#ifdef USE_STDPERIPH_DRIVER
#include "stm32f10x_conf.h"
#endif
stm32f10x_conf.h中包含了所有外设的头文件,因此任意源文件只要包含了stm32f10x.h,就可以在源文件调用任意外设的函数。
若有外设为使用到,在stm32f10x_conf.h注释相应部分,项目编译时就不会在编译去掉的外设。
举报