while(1)
{
key = KEY_Scan(0);
if(key == WKUP_PRES)
{
OSTaskSemPost(&Task2_TaskTCB,OS_OPT_POST_NONE,&err);
// LCD_ShowxNum(80,111,Task2_TaskTCB.SemCtr,3,16,0);
}
LCD_ShowxNum(80,111,Task2_TaskTCB.SemCtr,3,16,0);
LED0 = ~LED0;
OSTimeDlyHMSM(0,0,0,50,OS_OPT_TIME_PERIODIC,&err);
}
}
LCD_ShowxNum(80,111,Task2_TaskTCB.SemCtr,3,16,0);此行代码放于if内就OK
但放于if外,在按下按键的时候就导致花屏现象 |