File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
bsp/stm32f4xx-HAL/drivers Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -362,12 +362,16 @@ void CAN2_SCE_IRQHandler(void)
362362 */
363363void 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/**
Original file line number Diff line number Diff line change @@ -405,6 +405,7 @@ static rt_err_t rt_can_close(struct rt_device *dev)
405405
406406 rt_free (rx_fifo );
407407 dev -> open_flag &= ~RT_DEVICE_FLAG_INT_RX ;
408+ can -> can_rx = RT_NULL ;
408409 /* configure low level device */
409410 can -> ops -> control (can , RT_DEVICE_CTRL_CLR_INT , (void * )RT_DEVICE_FLAG_INT_RX );
410411 }
@@ -418,6 +419,7 @@ static rt_err_t rt_can_close(struct rt_device *dev)
418419
419420 rt_free (tx_fifo );
420421 dev -> open_flag &= ~RT_DEVICE_FLAG_INT_TX ;
422+ can -> can_tx = RT_NULL ;
421423 /* configure low level device */
422424 can -> ops -> control (can , RT_DEVICE_CTRL_CLR_INT , (void * )RT_DEVICE_FLAG_INT_TX );
423425 }
You can’t perform that action at this time.
0 commit comments