分享一段uCosII下多任务处理代码

启动一个任务:

osTaskCreate("HISTOGRAM", hisTask, (void *)2048, (void *)(&hisTaskStack[2047]), 60);

 

任务实现代码:

void hisTask(void *pdata) { UINT32 osdW, osdH; osdW = PANEL_1_OSD_W; osdH = PANEL_1_OSD_H; while(1) { //通过全局变量来改变任务的状态 if(((( uiState & UI_MODE_MASK ) == UI_MODE_PREVIEW_STILL) || (( uiState & UI_MODE_MASK ) == UI_MODE_PREVIEW_MOVIE))) { struct tm *ptime; timeGet(&ptime); ...要处理的事情 osdHistogramDraw(16, osdH - 32 -64, 16+96, osdH - 32, 0xc2); } } }

你可能感兴趣的:(分享一段uCosII下多任务处理代码)