Simplify CAN error code handler

This commit is contained in:
2026-06-10 13:15:01 +02:00
parent b38d4d5403
commit d641c8b915
+2 -2
View File
@@ -23,6 +23,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "canlog.h"
#include <system_error>
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@@ -445,8 +446,7 @@ void Error_Handler(void)
//TODO: check if it is necessary to stop FreeRTOS
uint32_t error_can1 == 0;
uint32_t error_can2 == 0;
uint32_t error_code;
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);