Return instead of critical error

- To find a way to handle overflows on the FIFO buffer
This commit is contained in:
2026-06-16 17:57:35 +02:00
parent 6446f5209b
commit 7d40531250
+2 -1
View File
@@ -71,7 +71,8 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
CAN_RxHeaderTypeDef rxHeader;
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.dlc = rxHeader.DLC;