void TaskRTC(void *pdata) { INT32U clk; char s[24]; pdata = pdata; while(1) { PC_GetDateTime(&s[0]); PC_DispStr(X_INTER1+16, Y_END+1, s, DISP_FGND_BLACK + DISP_BGND_LIGHT_GRAY + DISP_BLINK); OSTimeDly(1); //delay here for the kernel to switch to another task } }
void TaskClk (void *pdata) { char s[40]; pdata = pdata; for (;;) { PC_GetDateTime(s); PC_DispStr(58, 22, s, DISP_FGND_YELLOW + DISP_BGND_BLUE); OSTimeDlyHMSM(0, 0, 0, 500); } }
void TaskClk (void *pdata) { char s[40]; pdata = pdata; for (;;) { PC_GetDateTime(s); PC_DispStr(60, 23, s, DISP_FGND_YELLOW + DISP_BGND_BLUE); //display current date and time once a 500ms OSTimeDlyHMSM(0, 0, 0, 500); } }
void DisplayStatus ( void ) { char s[100]; sprintf(s, "%5d", OSTaskCtr); /* Display #tasks running */ PC_DispStr(18, 22, s, DISP_FGND_BLUE + DISP_BGND_CYAN); sprintf(s, "%3d", OSCPUUsage); /* Display CPU usage in % */ PC_DispStr(36, 22, s, DISP_FGND_BLUE + DISP_BGND_CYAN); sprintf(s, "%5d", OSCtxSwCtr); /* Display #context switches per second */ PC_DispStr(18, 23, s, DISP_FGND_BLUE + DISP_BGND_CYAN); OSCtxSwCtr = 0; sprintf(s, "V%3.2f", (float)OSVersion() * 0.01); /* Display version number as Vx.yy */ PC_DispStr(75, 24, s, DISP_FGND_YELLOW + DISP_BGND_BLUE); PC_GetDateTime(s); /* Get and display date and time */ PC_DispStr(0, 24, s, DISP_FGND_BLUE + DISP_BGND_CYAN); }