Return instead of critical error
- To find a way to handle overflows on the FIFO buffer
This commit is contained in:
+2
-1
@@ -71,7 +71,8 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
|
|||||||
CAN_RxHeaderTypeDef rxHeader;
|
CAN_RxHeaderTypeDef rxHeader;
|
||||||
uint8_t data[8];
|
uint8_t data[8];
|
||||||
|
|
||||||
if (HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &rxHeader, data) != HAL_OK) Error_Handler();
|
// TODO: manage the case of FIFO overflow
|
||||||
|
if (HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &rxHeader, data) != HAL_OK) return;
|
||||||
|
|
||||||
message.id = rxHeader.ExtId;
|
message.id = rxHeader.ExtId;
|
||||||
message.dlc = rxHeader.DLC;
|
message.dlc = rxHeader.DLC;
|
||||||
|
|||||||
Reference in New Issue
Block a user