gateway/Software/src/thread_communication.c

46 lines
717 B
C

/*
* mutex.c
*
* Created on: 2024年5月18日
* Author: 34509
*/
#include <thread_communication.h>
SL_UartSend_pack MqUartSend_pack;
/* 定义消息队列控制块 */
rt_mq_t mqSend = RT_NULL;
/**
* @brief 串口接收到数据后如果需要发送数据则通过这个队列传输信息给只能模块(本次测试将数据直接通过串口传输)
* @param
* @retval 1 创建成功
* 0 创建失败
*/
rt_uint8_t Send_mq_Init(void)
{
mqSend = rt_mq_create("Send_mq",/* 消息队列名字 */
100, /* 消息的最大长度 */
20, /* 消息队列的最大容量 */
RT_IPC_FLAG_FIFO); /* 队列模式 FIFO(0x00)*/
if (mqSend != RT_NULL)
return 1;
return 0;
}