#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
*/
#ifdef _RTE_
#include "RTE_Components.h"
#ifdef RTE_DEVICE_STDPERIPH_FRAMEWORK
#define USE_STDPERIPH_DRIVER
#endif
#endif
#endif
#if defined (STM32F10X_LD)
#error "STM32F10X_LD"
#endif
#if defined (STM32F10X_LD_VL)
#error "STM32F10X_LD_VL"
#endif
#if defined (STM32F10X_MD)
#error "STM32F10X_MD"
#endif
#if defined (STM32F10X_MD_VL)
#error "STM32F10X_MD_VL"
#endif
#if defined (STM32F10X_HD)
#error "STM32F10X_HD"
#endif
#if defined (STM32F10X_HD_VL)
#error "STM32F10X_HD_VL"
#endif
#if defined (STM32F10X_XL)
#error "STM32F10X_XL"
#endif
#if defined (STM32F10X_CL)
#error "STM32F10X_CL"
#endif
中断接口在.s文件中已经声明了。
找到了USE_STDPERIPH_DRIVER 的预处理。但是好像没有找到STM32F10X_MD的预处理。KEIL-5好像不用预处理STM32F10X_MD???KEIL4可不可以也不写STM32F10X_MD???
没找到#define STM32F10X_MD。。是stm32f103x.h吗?第几行啊?
#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)
/* #define STM32F10X_LD */ /*!< STM32F10X_LD: STM32 Low density devices */
/* #define STM32F10X_LD_VL */ /*!< STM32F10X_LD_VL: STM32 Low density Value Line devices */
/* #define STM32F10X_MD */ /*!< STM32F10X_MD: STM32 Medium density devices */
/* #define STM32F10X_MD_VL */ /*!< STM32F10X_MD_VL: STM32 Medium density Value Line devices */
/* #define STM32F10X_HD */ /*!< STM32F10X_HD: STM32 High density devices */
/* #define STM32F10X_HD_VL */ /*!< STM32F10X_HD_VL: STM32 High density value line devices */
/* #define STM32F10X_XL */ /*!< STM32F10X_XL: STM32 XL-density devices */
/* #define STM32F10X_CL */ /*!< STM32F10X_CL: STM32 Connectivity line devices */
#endif
嗯!#if !defined 预编译。假如STM32F10X的这些设备密度都没有定义就执行下面!可是下面都是注释掉的啊!
所以还是没有#defined STM32F10X_MD
搜了一下。有宏定义的就只有你写的这里了。
/* #define STM32F10X_MD */ /*!< STM32F10X_MD: STM32 Medium density devices */
#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
*/
#ifdef _RTE_
#include "RTE_Components.h"
#ifdef RTE_DEVICE_STDPERIPH_FRAMEWORK
#define USE_STDPERIPH_DRIVER
#endif
#endif
#endif
这是定义USE_STDPERIPH_DRIVER。这个#ifdef _RTE_
这个 _RTE_ 是什么???
STM32F103_DEMO.rar
2016-8-26 11:55 上传
点击文件名下载附件
下载积分: ST金币 -14.2 MB, 下载次数: 1, 下载积分: ST金币 -1
-D__UVISION_VERSION="517" -D_RTE_ -DSTM32F10X_MD -o ".\Objects\*.o" --omf_browse ".\Objects\*.crf" --depend ".\Objects\*.d"
--pd "__UVISION_VERSION SETA 517" --pd "_RTE_ SETA 1" --pd "STM32F10X_MD SETA 1" --list ".\Listings\*.lst" --xref -o "*.o" --depend "*.d"
#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)
#error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
#endif
根据上面这段话看错应该是定义了的!不过在工程中我实在没找到!包括您的那几句!。我是在KEIL默认创建的工程里找的!