|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2008-4-14 22:08:47
|
显示全部楼层
我的问题大概是这样的,在2.3任务里把两个数组通过消息队列发给任务一,任务一等待2,3任务来的消息,这时两则消息吧,那怎么在任务1中把传来的两个数组内容取出来呢,我现在的方式只能取出最先发来的消息中内容,麻烦各位了
static void AppTask1(void *p_arg)
{
char *rxmsg;
char a,b;
INT8U err;
p_arg = p_arg;
while (TRUE) {
rxmsg=(char *)OSQPend(QSem,0,&err);
if (a=='2'){
LCD_write_string(0,0,line1);
}
else
{LCD_write_string(0,1,line2);
}
switch(a)
{
case 2:
LCD_write_string(0,0,line1);
OSMboxPost(ad,(void *)&a[0][0]);
break;
case 3:
LCD_write_string(0,1,line1);
break;
default:
break;
}
OSTimeDly(100);
}
}
static void AppTask2(void *p_arg)
{
char CAP[2]={'2','4'};
INT8U err;
p_arg = p_arg;
while (TRUE){
OSQPost(QSem,(void *)&CAP);
OSTimeDly(3);
}
}
static void AppTask3(void *p_arg)
{
char AD[2]={'3','5'};
INT8U err;
p_arg = p_arg;
while (TRUE){
OSQPost(QSem,(void *)&AD);
OSTimeDly(3);
}
} |
|