#STM32F4#
报错显示:error: #136: struct "<unnamed>" has no field "BSRR" error: #136: struct "<unnamed>" has no field "BRR"
在F1中使用BSRR和BRR这两个寄存器
#define AIN2_HIGH() (GPIOB->BSRR = GPIO_Pin_12)
#define AIN2_LOW() (GPIOB->BRR = GPIO_Pin_12)
#define BIN1_HIGH() (GPIOB->BSRR = GPIO_Pin_15)
#define BIN1_LOW() (GPIOB->BRR = GPIO_Pin_15)
#define BIN2_HIGH() (GPIOB->BSRR = GPIO_Pin_14)
#define BIN2_LOW() (GPIOB->BRR = GPIO_Pin_14)
但是在F4中已经弃用这个写法,用BSRRH和BSRRL代替,这种命名比以前更容易理解
写法更改一下就行了。
#define AIN2_HIGH() (GPIOG->BSRRH = GPIO_Pin_9)
#define AIN2_LOW() (GPIOG->BSRRL= GPIO_Pin_9)
User\main.c(14): error: #5: cannot open source input file "PID.h": No such file or directory
User\main.c(14): error: #5: cannot open source input file "PID.h": No such file or directory
这个问题很简单搞定,纯粹是大意疏忽了,就像这样,去找到存放pid.h的文件地址然后添加就欧克了。