Browse Source

[bsp] fix CAN IRQ for stm32 none connectivity line devices

Spencer Moss 7 years ago
parent
commit
a07c450808
2 changed files with 18 additions and 2 deletions
  1. 3 2
      bsp/stm32f10x/drivers/bxcan.h
  2. 15 0
      bsp/stm32f10x/drivers/stm32f10x_it.c

+ 3 - 2
bsp/stm32f10x/drivers/bxcan.h

@@ -47,8 +47,9 @@
 #define CAN_TXMAILBOX_1                   ((uint8_t)0x01)
 #define CAN_TXMAILBOX_2                   ((uint8_t)0x02)
 
-
-
 #define CAN_MODE_MASK              ((uint32_t) 0x00000003)
 
+void CAN1_RX0_IRQHandler(void);
+void CAN1_TX_IRQHandler(void);
+
 #endif /*BXCAN_H_*/

+ 15 - 0
bsp/stm32f10x/drivers/stm32f10x_it.c

@@ -25,6 +25,7 @@
 #include "stm32f10x_it.h"
 #include <board.h>
 #include <rtthread.h>
+#include "bxcan.h"
 
 /** @addtogroup Template_Project
   * @{
@@ -144,6 +145,20 @@ void EXTI4_IRQHandler(void)
 }
 #endif /* RT_USING_LWIP */
 
+#if (defined (RT_USING_CAN)) && !(defined (STM32F10X_CL))
+/* CAN and USB IRQ for stm32 none connectivity line devices
+ * change to USB IRQ, if you want to use USB
+ */
+void USB_LP_CAN1_RX0_IRQHandler(void)
+{
+    CAN1_RX0_IRQHandler();
+}
+void USB_HP_CAN1_TX_IRQHandler(void)
+{
+    CAN1_TX_IRQHandler();
+}
+#endif
+
 /**
   * @}
   */