STM32单片机新手入门常见BUG之一
问题点:
error: use of undeclared identifier ‘PBout’
【BUG背景】
使用位操作,点亮LED灯
如下图所示,报错信息:error: use of undeclared identifier ‘PBout’
(单词翻译:undeclared:未声明的,idenfitier: 标识符)
【BUG原因】
经过查找发现BUG原因来自led.h文件中的宏定义,如下图所示,将LED0映射到PBout(5)上。
BUG原因:“()”是中文格式的
#define LED0 PBout (5)
【解决过程】
把中文格式的“()”改为英文格式的“()”,修改后BUG得到解决。
#define LED0 PBout(5)
所以新手敲代码时,一定要注意中英文的格式区别,养成每次输入前检查输入法,输入后检查内容的良好习惯!
走向财富自由,从输入法开始!^_^^_^