Fix error handling for CAN bus
This commit is contained in:
+5
-3
@@ -445,9 +445,11 @@ void Error_Handler(void)
|
|||||||
|
|
||||||
//TODO: check if it is necessary to stop FreeRTOS
|
//TODO: check if it is necessary to stop FreeRTOS
|
||||||
|
|
||||||
uint32_t error_code;
|
uint32_t error_can1 == 0;
|
||||||
if (hcan == &hcan1) error_code = HAL_CAN_GetError(&hcan1);
|
uint32_t error_can2 == 0;
|
||||||
else if (hcan == &hcan2) error_code = HAL_CAN_GetError(&hcan2);
|
|
||||||
|
if (HAL_CAN_GetState(&hcan1) != HAL_CAN_STATE_READY) error_code = HAL_CAN_GetError(&hcan1);
|
||||||
|
else if (HAL_CAN_GetState(&hcan2) != HAL_CAN_STATE_READY) error_code = HAL_CAN_GetError(&hcan2);
|
||||||
|
|
||||||
// TODO: write error to SD and/or serial
|
// TODO: write error to SD and/or serial
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user