rtx5 消息队列初始化

#define MSG_COM_TX_NUM 16
typedef struct
{
    uint16_t cmd;
    uint16_t len;
    uint8_t buff[32];
}com_msg_t;

osMessageQueueId_t msg_com_tx;
osSemaphoreId_t sem_com_add_msg;
osRtxMessageQueue_t  cb_mem;
uint8_t msg_com_tx_buff[MSG_COM_TX_NUM * (sizeof(com_msg_t) + +sizeof(cb_mem ))];


osMessageQueueAttr_t com_msg_tx_attr; com_msg_tx_attr.name = "msg_com_tx"; com_msg_tx_attr.cb_mem = &cb_mem; com_msg_tx_attr.cb_size = sizeof(cb_mem); com_msg_tx_attr.mq_mem = msg_com_tx_buff; com_msg_tx_attr.mq_size = sizeof(msg_com_tx_buff); msg_com_tx = osMessageQueueNew(MSG_COM_TX_NUM, sizeof(com_msg_t), &com_msg_tx_attr);
posted @ 2022-08-11 17:34  ccc_zdh  阅读(164)  评论(0)    收藏  举报