Files
CANdigger/Core/Src/cansend.c
T
eeeck 8b1b3b7ff3 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
2026-06-16 19:49:13 +02:00

37 lines
1.1 KiB
C

/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : cansend.c
* @brief : Send logged SAE J1939 CAN via serial and save via SDIO.
******************************************************************************
* @attention
*
* Copyright (c) 2026 Erick Ahmed.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
******************************************************************************
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "cansend.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "cmsis_os.h"
/* USER CODE END Includes */
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
if (huart->Instance == USART1)
{
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
osSemaphoreReleaseFromISR(xUartDmaSem, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
void vUARTLogger(void *argument)
{
}