../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h(97): error: #101: “DMA1_Channel5_IRQn“ h

在自己的文件里调用HAL库的文件时出现了大量报错比如30个报错之类的

"ws2812b\ws2812b.axf" - 30 Error(s), 3 Warning(s).

我的头文件是这样的

以下是报错

../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h(96): error:  #101: "DMA1_Channel4_IRQn" has already been declared in the current scope
    DMA1_Channel4_IRQn          = 14,     /*!< DMA1 Channel 4 global Interrupt                      */
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h(97): error:  #101: "DMA1_Channel5_IRQn" has already been declared in the current scope
    DMA1_Channel5_IRQn          = 15,     /*!< DMA1 Channel 5 global Interrupt                      */
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h(98): error:  #101: "DMA1_Channel6_IRQn" has already been declared in the current scope
    DMA1_Channel6_IRQn          = 16,     /*!< DMA1 Channel 6 global Interrupt                      */
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h(99): error:  #101: "DMA1_Channel7_IRQn" has already been declared in the current scope
    DMA1_Channel7_IRQn          = 17,     /*!< DMA1 Channel 7 global Interrupt                      */
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h(100): error:  #101: "ADC1_2_IRQn" has already been declared in the current scope
    ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h(101): error:  #101: "USB_HP_CAN1_TX_IRQn" has already been declared in the current scope
    USB_HP_CAN1_TX_IRQn         = 19,     /*!< USB Device High Priority or CAN1 TX Interrupts       */
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h(102): error:  #101: "USB_LP_CAN1_RX0_IRQn" has already been declared in the current scope
    USB_LP_CAN1_RX0_IRQn        = 20,     /*!< USB Device Low Priority or CAN1 RX0 Interrupts       */
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h(103): error:  #101: "CAN1_RX1_IRQn" has already been declared in the current scope
    CAN1_RX1_IRQn               = 21,     /*!< CAN1 RX1 Interrupt                                   */
..\User\WS2812B.c: 3 warnings, 30 errors
"ws2812b\ws2812b.axf" - 30 Error(s), 3 Warning(s).
Target not created.
Build Time Elapsed:  00:00:00

解决方法是 :

去掉重复包含的头文件:#include "stm32f10x.h"                  // Device header
因为  #include "tim.h"   里面已经有包含  #include "stm32f10x.h"    了
 

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值