fix:更新注释等

This commit is contained in:
2026-05-21 12:19:01 +08:00
parent fd65e9c6a2
commit 8ee0849831
54 changed files with 1145 additions and 683 deletions

View File

@@ -1,10 +1,10 @@
/**
******************************************************************************
* @file user\hal\_hal_usart.c
* @author luhuaishuai
* @file User\Driver\drv_usart.c
* @author 路淮
* @version v0.1
* @date 2026-1-12
* @brief Briefly describe the function of your function
* @date 2026-05-21
* @brief 串口驱动
******************************************************************************
*/
@@ -12,25 +12,24 @@
#include "drv_usart.h"
/* variables ------------------------------------------------------------------*/
uint8_t uart1_rx_buffer[UART1_RX_BUFFER_SIZE];
uint8_t uart1_tx_buffer[UART1_TX_BUFFER_SIZE];
uint8_t uart1_rx_buffer[UART1_RX_BUFFER_SIZE];// 4G模块接收缓冲区
uint8_t uart1_tx_buffer[UART1_TX_BUFFER_SIZE];// 4G模块发送缓冲区
uint8_t uart3_rx_buffer[UART3_RX_BUFFER_SIZE];
uint8_t uart3_tx_buffer[UART3_TX_BUFFER_SIZE];
uint8_t uart3_rx_buffer[UART3_RX_BUFFER_SIZE];// RS485模块接收缓冲区
uint8_t uart3_tx_buffer[UART3_TX_BUFFER_SIZE];// RS485模块发送缓冲区
static SemaphoreHandle_t air724_tx_mutex = NULL;// 4G模块发送互斥信号量
static SemaphoreHandle_t air724_tx_mutex = NULL;
/* code -----------------------------------------------------------------------*/
/**
* @brief fputcprintf映射
*
* @brief fputcprintf映射函数
* @note none
*
* @param none
*
* @param ch字符
* @param f文件指针
* @retval none
*/
int fputc(int ch, FILE *f)
{
HAL_UART_Transmit(&huart6, (uint8_t *)&ch, 1, HAL_MAX_DELAY);
@@ -39,11 +38,9 @@ int fputc(int ch, FILE *f)
/**
* @brief Air724_Message_Send4G数据发送
*
* @note none
*
* @param none
*
* @param data数据指针
* @param len数据长度
* @retval none
*/
void Air724_Message_Send(uint8_t *data, uint16_t len)
@@ -62,6 +59,13 @@ void Air724_Message_Send(uint8_t *data, uint16_t len)
}
}
/**
* @brief Rs485_Message_SendRS485数据发送
* @note none
* @param data数据指针
* @param len数据长度
* @retval none
*/
void Rs485_Message_Send(uint8_t *data, uint16_t len)
{
RS485_EN(1);
@@ -71,14 +75,10 @@ void Rs485_Message_Send(uint8_t *data, uint16_t len)
/**
* @brief drv_usart_init所有串口初始化
*
* @note none
*
* @param none
*
* @retval none
*/
void drv_usart_init(void)
{
air724_tx_mutex = xSemaphoreCreateMutex();
@@ -98,11 +98,9 @@ void drv_usart_init(void)
/**
* @brief HAL_UARTEx_RxEventCallback串口接收完成中断处理函数
*
* @note none
*
* @param none
*
* @param huart串口句柄
* @param Size接收数据大小
* @retval none
*/
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
@@ -123,11 +121,9 @@ void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
/**
* @brief air724_callback_fun4G数据接收回调函数
*
* @note none
*
* @param none
*
* @param huart串口句柄
* @param Size接收数据大小
* @retval none
*/
void air724_callback_fun()
@@ -138,6 +134,13 @@ void air724_callback_fun()
memset(uart1_rx_buffer, 0, UART1_RX_BUFFER_SIZE);
}
/**
* @brief rs485_callback_funRS485数据接收回调函数
* @note none
* @param huart串口句柄
* @param Size接收数据大小
* @retval none
*/
void rs485_callback_fun()
{
BaseType_t xHigherPriorityTaskWoken = pdFALSE;