mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-19 03:43:30 +08:00
commit
b626deba35
@ -362,12 +362,16 @@ void CAN2_SCE_IRQHandler(void)
|
|||||||
*/
|
*/
|
||||||
void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan)
|
void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan)
|
||||||
{
|
{
|
||||||
/* TODO Error Callback */
|
__HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG |
|
||||||
/* Prevent unused argument(s) compilation warning */
|
CAN_IT_EPV |
|
||||||
UNUSED(hcan);
|
CAN_IT_BOF |
|
||||||
/* NOTE : This function Should not be modified, when the callback is needed,
|
CAN_IT_LEC |
|
||||||
the HAL_CAN_ErrorCallback could be implemented in the user file
|
CAN_IT_ERR |
|
||||||
*/
|
CAN_IT_FMP0|
|
||||||
|
CAN_IT_FOV0|
|
||||||
|
CAN_IT_FMP1|
|
||||||
|
CAN_IT_FOV1|
|
||||||
|
CAN_IT_TME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -405,6 +405,7 @@ static rt_err_t rt_can_close(struct rt_device *dev)
|
|||||||
|
|
||||||
rt_free(rx_fifo);
|
rt_free(rx_fifo);
|
||||||
dev->open_flag &= ~RT_DEVICE_FLAG_INT_RX;
|
dev->open_flag &= ~RT_DEVICE_FLAG_INT_RX;
|
||||||
|
can->can_rx = RT_NULL;
|
||||||
/* configure low level device */
|
/* configure low level device */
|
||||||
can->ops->control(can, RT_DEVICE_CTRL_CLR_INT, (void *)RT_DEVICE_FLAG_INT_RX);
|
can->ops->control(can, RT_DEVICE_CTRL_CLR_INT, (void *)RT_DEVICE_FLAG_INT_RX);
|
||||||
}
|
}
|
||||||
@ -418,6 +419,7 @@ static rt_err_t rt_can_close(struct rt_device *dev)
|
|||||||
|
|
||||||
rt_free(tx_fifo);
|
rt_free(tx_fifo);
|
||||||
dev->open_flag &= ~RT_DEVICE_FLAG_INT_TX;
|
dev->open_flag &= ~RT_DEVICE_FLAG_INT_TX;
|
||||||
|
can->can_tx = RT_NULL;
|
||||||
/* configure low level device */
|
/* configure low level device */
|
||||||
can->ops->control(can, RT_DEVICE_CTRL_CLR_INT, (void *)RT_DEVICE_FLAG_INT_TX);
|
can->ops->control(can, RT_DEVICE_CTRL_CLR_INT, (void *)RT_DEVICE_FLAG_INT_TX);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user