From 5e47dc41b3b28534782ed6f7447e46badae6bb9a Mon Sep 17 00:00:00 2001 From: Noe Xu Date: Mon, 7 Jan 2019 00:27:01 -0800 Subject: [PATCH] [STM32] Fix issue that CAN driver won't receive any messages once OV iterrupt occurs. Change-Id: I4cd98ca4840f32925e89e8c467ec78e03e9a2836 --- bsp/stm32f4xx-HAL/drivers/drv_can.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bsp/stm32f4xx-HAL/drivers/drv_can.c b/bsp/stm32f4xx-HAL/drivers/drv_can.c index 603a2a745b..c19ce2584e 100644 --- a/bsp/stm32f4xx-HAL/drivers/drv_can.c +++ b/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); } /** -- GitLab