使用KEIL5编译器,在C/C++ 选择预编译栏目里 填写 GD32F10X_HD
编译的时候,则出现
*** Using Compiler 'V5.05 update 2 (build 169)', folder: 'D:\Keil\v515\ARM\ARMCC\Bin'
compiling gd32_periph_init.c...
.\User\CMSIS\gd32f10x.h(143): error: #101: "USBD_HP_CAN0_TX_IRQn" has already been declared in the current scope
USBD_HP_CAN0_TX_IRQn = 19, /*!< CAN0 TX interrupts */
.\User\CMSIS\gd32f10x.h(144): error: #101: "USBD_LP_CAN0_RX0_IRQn" has already been declared in the current scope
USBD_LP_CAN0_RX0_IRQn = 20, /*!< CAN0 RX0 interrupts */
.\User\CMSIS\gd32f10x.h(145): error: #101: "CAN0_RX1_IRQn" has already been declared in the current scope
CAN0_RX1_IRQn = 21, /*!< CAN0 RX1 interrupts */
.\User\CMSIS\gd32f10x.h(146): error: #101: "CAN0_EWMC_IRQn" has already been declared in the current scope
CAN0_EWMC_IRQn = 22, /*!< CAN0 EWMC interrupts */
.\User\CMSIS\gd32f10x.h(147): error: #101: "EXTI5_9_IRQn" has already been declared in the current scope
EXTI5_9_IRQn = 23, /*!< EXTI[9:5] interrupts */
.\User\CMSIS\gd32f10x.h(148): error: #101: "TIMER0_BRK_IRQn" has already been declared in the current scope
TIMER0_BRK_IRQn = 24, /*!< TIMER0 break interrupts */
.\User\CMSIS\gd32f10x.h(149): error: #101: "TIMER0_UP_IRQn" has already been declared in the current scope.....
....此处略去
找到问题 发现原因如下: RET6处于 HD的产品,器件选型如果选错,就会冲突. startup_gd32f10x_hd.s 。 在KEIL5的器件选型里,注意选的器件全名跟你的启动文件是吻合的!
|