我创建了三个任务,Task_Touch优先级最高,Task_Start任务最低,Task_Menu任务中间,在Task_Menu中创建了一些按钮,我现在想点击某个按钮,用
GUI_MessageBox("Function does not support!","NOTE",GUI_MESSAGEBOX_CF_MOVEABLE);
弹出一个消息框,现在的问题是弹出消息框后 无法点击消息框的按钮,仿真发现卡在函数WM_Exec()函数里面,甚至连任务Task_Touch都进不去了....不明白什么原因,望指教...谢谢了
下面是主要代码:
void Task_Start(void*p_arg)
{
OSTaskCreate(Task_Touch,(void*)0,&TASK_TOUCH_STK[TASK_TOUCH_STK_SIZE-1],TASK_TOUCH_PRIO);
OSTaskCreate(Task_Menu,(void*)0,&TASK_MENU_STK[TASK_MENU_STK_SIZE-1],TASK_MENU_PRIO);
while(1)
{
LED1(ON);
OSTimeDlyHMSM(0,0,0,300);
LED1(OFF);
OSTimeDlyHMSM(0,0,0,300);
}
}
void Task_Touch(void*p_arg)
{
GUI_PID_STATE TouchPoint;
(void)p_arg;
while(1)
{
GUI_TOUCH_Exec();
GUI_TOUCH_GetState(&TouchPoint);
if (TouchPoint.Pressed)
{
if(TouchFlag == TouchUnPressed)
{
TouchFlag = TouchPress;
}
}
else
{
if(TouchFlag == TouchPressed)
{
TouchFlag = TouchUnPress;
}
}
GUI_Exec();//重绘
OSTimeDlyHMSM(0,0,0,5);
}
}
void Task_Menu(void*p_arg)
{
(void)p_arg;
MainMenu_Init(); //在桌面上创建了一些按钮
while(1)
{
if((Menu_ID==MainMenu_ID)&&TouchCmd==1) //为了区分当前的界面
{
TouchCmd = 0;
switch(GUI_GetKey())
{
case GUI_ID_BUTTON0:
GUI_MessageBox("Function does not support!","NOTE",GUI_MESSAGEBOX_CF_MOVEABLE);//就是卡在这里了
break;
default:
TouchCmd = 1;
break;
}
}
OSTimeDlyHMSM(0,0,0,20);
}
}
#define GUI_ALLOC_SIZE 10240 //这个也够大了吧 |
|