Merge pull request 'Implement CAN bus reading with CMSIS-RTOS-V2' (#14) from j1939 into main #14

Manually merged
eeeck merged 71 commits from j1939 into main 2026-06-15 10:30:45 +02:00
Showing only changes of commit 87e8ffc6fa - Show all commits
+12
View File
@@ -54,6 +54,7 @@ DMA_HandleTypeDef hdma_sdio_tx;
/* USER CODE BEGIN PV */
LED_Config led_can1 = {GPIOB, GPIO_PIN_2};
LED_Config led_can2 = {GPIOB, GPIO_PIN_5};
LED_Config led_error = {GPIOB, GPIO_PIN_3};
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
@@ -441,8 +442,19 @@ void Error_Handler(void)
/* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return state */
__disable_irq();
//TODO: check if it is necessary to stop FreeRTOS
uint32_t error_code;
if (hcan == &hcan1) error_code = HAL_CAN_GetError(&hcan1);
else if (hcan == &hcan2) error_code = HAL_CAN_GetError(&hcan2);
// TODO: write error to SD and/or serial
while (1)
{
HAL_GPIO_TogglePin(led_error.port, led_error.pin);
HAL_Delay(250);
}
/* USER CODE END Error_Handler_Debug */
}