庫V3.5 main等源文件中不再直接包含stm32f10x_conf.h,而是stm32f10x.h,主程序第一句話就是#include“stm32f10x.h”。而stm32f10x_conf.h被包含在了stm32f10x.h中,間接包含進(jìn)了用戶主程序文件。stm32f10x.h則定義了啟動設(shè)置,以及所有寄存器宏定義,此文件中需要注意的有:
設(shè)備(device)
#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL)
#endif
判斷是否選擇了設(shè)備(device),取消下面任何一個注釋,可以進(jìn)行默認(rèn)設(shè)備
#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL)
#endif
未選擇任何設(shè)備時,將會報錯,所以在這之前的地“open for targe->C++”中需要預(yù)定義設(shè)備,我自己的是STM32F10X_HD。
#if !defined USE_STDPERIPH_DRIVER
#endif
#ifdef USE_STDPERIPH_DRIVER
#endif
所以也要對USE_STDPERIPH_DRIVER進(jìn)行預(yù)定義,否則我們將無法使用庫件庫