Implement safe UART semaphore release inside ISR

- It uses safe way to release semaphore
- Yields in case task interrupted was of lower priority: UART has
  minimal latency
This commit is contained in:
2026-06-16 19:49:13 +02:00
parent 0d0e485193
commit 8b1b3b7ff3
+14 -2
View File
@@ -20,5 +20,17 @@
#include "cmsis_os.h" #include "cmsis_os.h"
/* USER CODE END Includes */ /* USER CODE END Includes */
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart); void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
void vUARTLogger(void *argument); {
if (huart->Instance == USART1)
{
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
osSemaphoreReleaseFromISR(xUartDmaSem, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
void vUARTLogger(void *argument)
{
}