📄 testosmsgqcreate.c
字号:
#include "msgqTest.h"
int testOSMsgQCreate()
{
OS_STATUS status;
unsigned32 MsgQ_id1,MsgQ_id2,MsgQ_id3;
printf("*** test of OSMsgQCreate ***\n");
printf("create MsgQ1 with [100][20][OS_FIFO]\n");
status = OSMsgQCreate("msg1",100,20,OS_FIFO,&MsgQ_id1);
if(status != OS_OK)
{
printf("OSMsgQCreate error:[%s]\n",serrno(errno));
return (-1);
}
printf("the id of MsgQ1 is %d\n",MsgQ_id1);
printf("create MsgQ2 with [50][50][OS_PRI]\n");
status = OSMsgQCreate("msg2",50,50,OS_PRI,&MsgQ_id2);
if(status != OS_OK)
{
printf("OSMsgQCreate error:[%s]\n",serrno(errno));
return (-1);
}
printf("the id of MsgQ2 is %d\n",MsgQ_id2);
printf("create MsgQ3 with [10][40][OS_DEFAULT]\n");
status = OSMsgQCreate("msg3",10,40,OS_DEFAULT,&MsgQ_id3);
if(status != OS_OK)
{
printf("OSMsgQCreate error:[%s]\n",serrno(errno));
return (-1);
}
printf("the id of MsgQ3 is %d\n",MsgQ_id3);
OSMsgQDelete(MsgQ_id1);
OSMsgQDelete(MsgQ_id2);
OSMsgQDelete(MsgQ_id3);
printf("*** OSMsgQCreate test OK! ***\n\n");
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -