主函数循环,检测按键并切换按钮及显示内容 while(1) {
delay_xms(200);ts++;
if(Board_Button_GetKeyVal()==0x01) {button1.state =0;button2.state =0;button0.state=1;
GUI_ImgButton(242, 40,button0);
GUI_ImgButton(242, 80,button1);
GUI_ImgButton(242, 120,button2);
blink=TRUE;GUI_RectangleFill(1,26,238,219,LightGrey);};
if(Board_Button_GetKeyVal()==0x02) {button2.state =0;button0.state =0;button1.state=1;
GUI_ImgButton(242, 40,button0);
GUI_ImgButton(242, 80,button1);
GUI_ImgButton(242, 120,button2);
LCD_ShowBmp(1,46,mm);blink=FALSE;}
if(Board_Button_GetJoyVal()==0x40) {button0.state =0;button1.state =0;button2.state=1;
GUI_ImgButton(242, 40,button0);
GUI_ImgButton(242, 80,button1);
GUI_ImgButton(242, 120,button2);
LCD_ShowBmp(1,46,mm2);blink=FALSE;}
|