要特别注意stm32f10x.h文件
//设定CPU的类型 //#if !defined (STM32F10X_LD) && !defined (STM32F10X_MD) && !defined (STM32F10X_HD) /* #define STM32F10X_LD */ /*!< STM32 Low density devices */ /* #define STM32F10X_MD */ /*!< STM32 Medium density devices */ #define STM32F10X_HD /*!< STM32 High density devices */ //#endif
//使用标准外设驱动 //#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
然后在stm32f10x_conf.h中通过注释来使能或禁止外设 |