为什么一进入while循环等待就会成这样了??void main()
{
inuart1();
inuart2();
IntTInit(); //外部中断
OLED_Init();
cleartempbuff();
OLED_Display_Clear();
OLED_Display_Chinese(0,0,0);
OLED_Display_Chinese(16,0,1);
OLED_Display_Chinese(32,0,2);
OLED_Display_Chinese(48,0,3);
OLED_Display_Chinese(0,2,4);
OLED_Display_Chinese(16,2,5);
OLED_Display_Chinese(32,2,6);
OLED_Display_Chinese(48,2,7);
OLED_Display_Chinese(0,4,8);
OLED_Display_Chinese(16,4,9);
OLED_Display_Chinese(32,4,10);
OLED_Display_Chinese(48,4,11);
OLED_Display_Chinese(64,4,12);
OLED_Display_Chinese(80,4,14);
OLED_Display_Chinese(96,4,15);
while(1){
loop:
i = 0;
k5 = 1;
if(choic == 1){
OLED_Display_Clear();
OLED_Display_Chinese(0,0,32);
OLED_Display_Chinese(16,0,33);
OLED_Display_Chinese(32,0,34);
OLED_Display_Chinese(48,0,35);
OLED_Display_Chinese(64,0,36);
OLED_Display_Chinese(80,0,37);
OLED_Display_Chinese(96,0,38);
}
while(k1&k2){ //按键等待 此时时间旧会出现白色横条
Delay500ms();
}
//执行代码
.................
P_SW2 &= ~S2_S0; //S2_S0=0 (P1.0/RxD2, P1.1/TxD2)
S2CON = 0x50; //打开串口2接收口
while(!(S2CON & S2RI) & !datawatch){ //等待串口2输入 此时时间旧会出现白色横条
if(k5 == 0){
choic = 1;
goto loop; //中断按键 回到任务选择
}
}
//执行代码........
|