昨天学习STM32的UART串口部分的代码,因为之前学习系统定时器,所以想综合一下这两个程序,没想到遇到如下问题:
Source\main.c(49): error: #20: identifier "GPIO_LED" is undefined
感觉很郁闷,因为我已经在"platform_config.h"中定义了
#ifdef USE_STM3210B_EVAL
#elif defined USE_STM3210E_EVAL
#endif
总之查找了一天都没有找到原因,所以昨天我的整个人都感觉不好,今天早上在度娘里偶然看到了一篇文章,于是瞬间拨开乌云。
问题原因:stm32f10x_conf.h中将GPIOF给屏蔽掉了。
#define _GPIO
#define _GPIOA
#define _GPIOB
#define _GPIOC
#define _GPIOD
#define _GPIOE
//#define _GPIOF
#define _GPIOG
#define _AFIO
将以上代码修改,祛除屏蔽,然后你的整个人都爽了
#define _GPIO
#define _GPIOA
#define _GPIOB
#define _GPIOC
#define _GPIOD
#define _GPIOE
#define _GPIOF
#define _GPIOG
#define _AFIO