2026-03-31 15:46:04 +08:00
|
|
|
|
/**
|
|
|
|
|
|
******************************************************************************
|
2026-05-21 12:19:01 +08:00
|
|
|
|
* @file User\Os\os_queue.c
|
|
|
|
|
|
* @author 路淮
|
2026-03-31 15:46:04 +08:00
|
|
|
|
* @version v0.1
|
2026-05-21 12:19:01 +08:00
|
|
|
|
* @date 2026-05-21
|
|
|
|
|
|
* @brief 队列管理
|
2026-03-31 15:46:04 +08:00
|
|
|
|
******************************************************************************
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/* Includes -------------------------------------------------------------------*/
|
|
|
|
|
|
#include "os_queue.h"
|
2026-05-21 10:01:28 +08:00
|
|
|
|
#include "task_udp.h"
|
2026-03-31 15:46:04 +08:00
|
|
|
|
|
|
|
|
|
|
/*-内核对象句柄-队列-*/
|
|
|
|
|
|
QueueHandle_t Air724_Message_Queue = NULL; /* 4G数据接收队列 */
|
|
|
|
|
|
QueueHandle_t RS485_Message_Queue = NULL; /* RS485数据接收队列 */
|
|
|
|
|
|
QueueHandle_t UDP_Message_Queue = NULL; /* UDP数据接收队列 */
|
|
|
|
|
|
|
|
|
|
|
|
/* code --------------------------------------------------------------------------------------------------------*/
|
2026-05-21 12:19:01 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* @brief Air724_Message_Queue_Init:4G数据接收队列初始化
|
|
|
|
|
|
* @note 初始化4G数据接收队列,队列大小为20,每个元素大小为UART1_RX_BUFFER_SIZE
|
|
|
|
|
|
* @param none
|
|
|
|
|
|
* @retval none
|
|
|
|
|
|
*/
|
2026-03-31 15:46:04 +08:00
|
|
|
|
void Air724_Message_Queue_Init(void)
|
|
|
|
|
|
{
|
2026-05-21 10:01:28 +08:00
|
|
|
|
Air724_Message_Queue = xQueueCreate(20, UART1_RX_BUFFER_SIZE);
|
2026-03-31 15:46:04 +08:00
|
|
|
|
if (Air724_Message_Queue == NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
printf("Air724_Message_Queue_Init Failed\r\n");
|
|
|
|
|
|
// 创建失败处理
|
|
|
|
|
|
Error_Handler();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-05-21 12:19:01 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* @brief RS485_Message_Queue_Init:RS485数据接收队列初始化
|
|
|
|
|
|
* @note 初始化RS485数据接收队列,队列大小为5,每个元素大小为UART3_RX_BUFFER_SIZE
|
|
|
|
|
|
* @param none
|
|
|
|
|
|
* @retval none
|
|
|
|
|
|
*/
|
2026-03-31 15:46:04 +08:00
|
|
|
|
void RS485_Message_Queue_Init(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
RS485_Message_Queue = xQueueCreate(5, UART3_RX_BUFFER_SIZE);
|
|
|
|
|
|
if (RS485_Message_Queue == NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 创建失败处理
|
|
|
|
|
|
printf("RS485_Message_Queue_Init error\r\n");
|
|
|
|
|
|
Error_Handler();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-05-21 12:19:01 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* @brief UDP_Message_Queue_Init:UDP数据接收队列初始化
|
|
|
|
|
|
* @note 初始化UDP数据接收队列,队列大小为20,每个元素大小为UdpMsg_t
|
|
|
|
|
|
* @param none
|
|
|
|
|
|
* @retval none
|
|
|
|
|
|
*/
|
2026-03-31 15:46:04 +08:00
|
|
|
|
void UDP_Message_Queue_Init(void)
|
|
|
|
|
|
{
|
2026-05-21 10:01:28 +08:00
|
|
|
|
UDP_Message_Queue = xQueueCreate(20, sizeof(UdpMsg_t));
|
2026-03-31 15:46:04 +08:00
|
|
|
|
if (UDP_Message_Queue == NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 创建失败处理
|
|
|
|
|
|
printf("UDP_Message_Queue_Init Failed\r\n");
|
|
|
|
|
|
Error_Handler();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|