[mw_shl_code=c,true]//EMWINDEMO任务
void emwindemo_task(void *p_arg)
{
BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX);
DROPDOWN_SetDefaultSkin(DROPDOWN_SKIN_FLEX);
FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
HEADER_SetDefaultSkin(HEADER_SKIN_FLEX);
MENU_SetDefaultSkin(MENU_SKIN_FLEX);
MULTIPAGE_SetDefaultSkin(MULTIPAGE_SKIN_FLEX);
PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
RADIO_SetDefaultSkin(RADIO_SKIN_FLEX);
SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX);
SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX);
SPINBOX_SetDefaultSkin(SPINBOX_SKIN_FLEX);
CreateX_BOX();
// GUI_CURSOR_Show();//光标显示
GUI_SetBkColor(GUI_BLACK);
GUI_Clear();
GUI_SetColor(GUI_BLUE);
GUI_SetFont(&GUI_FontHZ24);
GUI_DispStringAt("X-BOX MP3播放器",50,10);
while(1)
{
GUI_Delay(100);
}
}
//MP3任务
//===================================================//
void mp3_play_task(void *p_arg)
{
OS_ERR err;
// VS_Init(); //初始化VS1053
while(1)
{
// LED1=!LED1;
mp3_play();
OSTimeDlyHMSM(0,0,0,1,OS_OPT_TIME_PERIODIC,&err);//延时1ms
}
}
//字库更新任务
//KEY_UP键长按2s更新字库
void fontupdata_task(void *p_arg)
{
OS_ERR err;
while(1)
{
if(WK_UP == 1) //KEY_UP键按下
{
OSTimeDlyHMSM(0,0,2,0,OS_OPT_TIME_PERIODIC,&err);//延时2s
if(WK_UP == 1) //还是KEY_UP键
{
LCD_Clear(WHITE);
OSSchedLock(&err); //调度器上锁
LCD_ShowString(10,50,250,30,16,"Font Updataing,Please Wait...");
update_font(10,70,16,"0:");//更新字库
LCD_Clear(WHITE);
POINT_COLOR = RED;
LCD_ShowString(10,50,280,30,16,"Font Updata finshed,Please Restart!");
OSSchedUnlock(&err); //调度器解锁
}
}
OSTimeDlyHMSM(0,0,0,10,OS_OPT_TIME_PERIODIC,&err);//延时10ms
}
}
//TOUCH任务
void touch_task(void *p_arg)
{
OS_ERR err;
while(1)
{
GUI_TOUCH_Exec();
OSTimeDlyHMSM(0,0,0,25,OS_OPT_TIME_PERIODIC,&err);//延时25ms
}
}
//LED0任务
void led0_task(void *p_arg)
{
OS_ERR err;
while(1)
{
LED0 = !LED0;
// mp3_play();
OSTimeDlyHMSM(0,0,0,1000,OS_OPT_TIME_PERIODIC,&err);//延时1000ms
}
}[/mw_shl_code]
这是任务分布,求大神指点,更改了优先级,MP3任务最高的话屏幕就会不好用,现在屏幕按键没有问题,但是播放偶尔会有卡顿2秒左右,然后再正常播放
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>