Quellcode durchsuchen

[STM32] Fix issue that CAN driver won't receive any messages once OV iterrupt occurs.

Change-Id: I4cd98ca4840f32925e89e8c467ec78e03e9a2836
Noe Xu vor 6 Jahren
Ursprung
Commit
5e47dc41b3
1 geänderte Dateien mit 10 neuen und 6 gelöschten Zeilen
  1. 10 6
      bsp/stm32f4xx-HAL/drivers/drv_can.c

+ 10 - 6
bsp/stm32f4xx-HAL/drivers/drv_can.c

@@ -362,12 +362,16 @@ void CAN2_SCE_IRQHandler(void)
  */
 void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan)
 {
-    /* TODO Error Callback */
-    /* Prevent unused argument(s) compilation warning */
-    UNUSED(hcan);
-    /* NOTE : This function Should not be modified, when the callback is needed,
-       the HAL_CAN_ErrorCallback could be implemented in the user file
-    */
+    __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG |
+                               CAN_IT_EPV |
+                               CAN_IT_BOF |
+                               CAN_IT_LEC |
+                               CAN_IT_ERR |
+                               CAN_IT_FMP0|
+                               CAN_IT_FOV0|
+                               CAN_IT_FMP1|
+                               CAN_IT_FOV1|
+                               CAN_IT_TME);
 }
 
 /**