学习stm32遇到问题解决一:在宏定义对寄存器操作编译时报错 error:  #20: identifier "GPIO_PIN_xx" is undefined

在宏定义对寄存器操作编译时报错 error:  #20: identifier "GPIO_PIN_xx" is undefined

学习stm32遇到问题解决一:在宏定义对寄存器操作编译时报错 error:  #20: identifier "GPIO_PIN_xx" is undefined

使用声明时错误现象:

学习stm32遇到问题解决一:在宏定义对寄存器操作编译时报错 error:  #20: identifier "GPIO_PIN_xx" is undefined

编译时报错:

学习stm32遇到问题解决一:在宏定义对寄存器操作编译时报错 error:  #20: identifier "GPIO_PIN_xx" is undefined

经检查发现在宏定义操作寄存器时代把"GPIOC->BSRR = GPIO_Pin_xx"写成了"GPIOC->BSRR = GPIO_PIN_xx"导致报错。

把"PIN"改成"Pin"后问题解决:

学习stm32遇到问题解决一:在宏定义对寄存器操作编译时报错 error:  #20: identifier "GPIO_PIN_xx" is undefined

 

学习stm32遇到问题解决一:在宏定义对寄存器操作编译时报错 error:  #20: identifier "GPIO_PIN_xx" is undefined

 

学习stm32遇到问题解决一:在宏定义对寄存器操作编译时报错 error:  #20: identifier "GPIO_PIN_xx" is undefined