Skip to content

Commit 5e47dc4

Browse files
committed
[STM32] Fix issue that CAN driver won't receive any messages once OV iterrupt occurs.
Change-Id: I4cd98ca4840f32925e89e8c467ec78e03e9a2836
1 parent d55a9cd commit 5e47dc4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

bsp/stm32f4xx-HAL/drivers/drv_can.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,16 @@ void CAN2_SCE_IRQHandler(void)
362362
*/
363363
void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan)
364364
{
365-
/* TODO Error Callback */
366-
/* Prevent unused argument(s) compilation warning */
367-
UNUSED(hcan);
368-
/* NOTE : This function Should not be modified, when the callback is needed,
369-
the HAL_CAN_ErrorCallback could be implemented in the user file
370-
*/
365+
__HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG |
366+
CAN_IT_EPV |
367+
CAN_IT_BOF |
368+
CAN_IT_LEC |
369+
CAN_IT_ERR |
370+
CAN_IT_FMP0|
371+
CAN_IT_FOV0|
372+
CAN_IT_FMP1|
373+
CAN_IT_FOV1|
374+
CAN_IT_TME);
371375
}
372376

373377
/**

0 commit comments

Comments
 (0)