Do check UART only with semaphore protection

This commit is contained in:
2026-06-24 15:35:55 +02:00
parent 88b3fd873c
commit 9d263c5bfd
+1 -2
View File
@@ -131,14 +131,13 @@ void vUARTLogger(void *argument)
if (osMessageQueueGet(xUARTQueue, &message, NULL, queue_timeout) == osOK)
{
osSemaphoreAcquire(xUARTDMASemaphore, osWaitForever);
if (huart1.gState != HAL_UART_STATE_READY)
{
HAL_UART_Abort(&huart1);
HAL_UART_Init(&huart1);
}
osSemaphoreAcquire(xUARTDMASemaphore, osWaitForever);
int len = format_can_message(tx_buffer, message.source, &message);
HAL_UART_Transmit(&huart1, (uint8_t*)tx_buffer, len, 100);