8b1b3b7ff3
- It uses safe way to release semaphore - Yields in case task interrupted was of lower priority: UART has minimal latency
37 lines
1.1 KiB
C
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)
|
|
{
|
|
|
|
}
|