meun.c
上传用户:nbddcb
上传日期:2022-05-19
资源大小:48k
文件大小:4k
- #include "meun.h"
- #include "demo.h"
- void (*KeyFuncPtr)();
- uchar KeyFuncIndex = 0;
- KbdTabStruct code KeyTab[SIZE_OF_KEYBD_MENU]=
- {
- { 0, 4, 6, 1,(*func0)},
- { 1, 2, 3, 0,(*func1)},
- { 2, 3, 1, 0,(*func2)},
- { 3, 1, 2, 0,(*func3)},
- { 4, 6, 0, 5,(*func4)},
- { 5, 7, 7, 4,(*func5)},
- { 6, 0, 4, 8,(*func6)},
- { 7, 5, 5, 4,(*func7)},
- { 8, 9, 9, 6,(*func8)},
- { 9, 8, 8, 6,(*func9)}
- };
- void delay(unsigned int i)
- {
- unsigned int j;
- for(j=6000;j>0;j--)
- for(;i>0;i--);
- }
- void func0(void)
- {
- int i;
- MB90092_DisChar(1,2,0x0c,0,1,4,1);
- for (i=0;i<5;i++)
- MB90092_DisChar(i+3,2,0x00+i,0,1,4,1);
- for (i=0;i<5;i++)
- MB90092_DisChar(i+3,3,0x05+i,0,1,4,1);
- for (i=0;i<5;i++)
- MB90092_DisChar(i+3,4,0x41+i,0,1,4,1);
- }
- void func1(void)
- {
- int i;
- MB90092_DisChar(1,2,0x0c,0,1,4,1);
- for (i=0;i<3;i++)
- MB90092_DisChar(i+3,2,0x180+i,0,1,4,1);
- for (i=0;i<2;i++)
- MB90092_DisChar(i+3,3,0xB6+i,0,1,4,1);
- MB90092_DisChar(3,4,0x0b,0,1,4,1);
- }
- void func2(void)
- {
- int i;
- MB90092_DisChar(1,3,0x0c,0,1,4,1);
- for (i=0;i<3;i++)
- MB90092_DisChar(i+3,2,0x180+i,0,1,4,1);
- for (i=0;i<2;i++)
- MB90092_DisChar(i+3,3,0xB6+i,0,1,4,1);
- MB90092_DisChar(3,4,0x0b,0,1,4,1);
- }
-
- void func3(void)
- {
- int i;
- MB90092_DisChar(1,4,0x0c,0,1,4,1);
- for (i=0;i<3;i++)
- MB90092_DisChar(i+3,2,0x180+i,0,1,4,1);
- for (i=0;i<2;i++)
- MB90092_DisChar(i+3,3,0xB6+i,0,1,4,1);
- MB90092_DisChar(3,4,0x0b,0,1,4,1);
- }
- void func4(void)
- {
- int i;
- MB90092_DisChar(1,3,0x0c,0,1,4,1);
- for (i=0;i<5;i++)
- MB90092_DisChar(i+3,2,0x00+i,0,1,4,1);
- for (i=0;i<5;i++)
- MB90092_DisChar(i+3,3,0x05+i,0,1,4,1);
- for (i=0;i<5;i++)
- MB90092_DisChar(i+3,4,0x41+i,0,1,4,1);
- }
- void func5(void)
- {
- int i;
- MB90092_DisChar(1,2,0x0c,0,1,4,1);
- for (i=1;i<10;i=i+2)
- MB90092_DisChar(i+3,2,0x00+i,0,1,4,1);
- MB90092_DisChar(3,3,0x0b,0,1,4,1);
- }
- void func6(void)
- {
- int i;
- MB90092_DisChar(1,4,0x0c,0,1,4,1);
- for (i=0;i<5;i++)
- MB90092_DisChar(i+3,2,0x00+i,0,1,4,1);
- for (i=0;i<5;i++)
- MB90092_DisChar(i+3,3,0x05+i,0,1,4,1);
- for (i=0;i<5;i++)
- MB90092_DisChar(i+3,4,0x41+i,0,1,4,1);
- }
- void func7(void)
- {
- int i;
- MB90092_DisChar(1,3,0x0c,0,1,4,1);
- for (i=1;i<10;i=i+2)
- MB90092_DisChar(i+3,2,0x00+i,0,1,4,1);
- MB90092_DisChar(3,3,0x0b,0,1,4,1);
- }
- void func8(void)
- {
- int i;
- MB90092_DisChar(1,2,0x0c,0,1,4,1);
- for (i=0;i<10;i=i+2)
- MB90092_DisChar(i+3,2,0x00+i,0,1,4,1);
- MB90092_DisChar(3,3,0x0b,0,1,4,1);
- }
- void func9(void)
- {
- int i;
- MB90092_DisChar(1,3,0x0c,0,1,4,1);
- for (i=0;i<10;i=i+2)
- MB90092_DisChar(i+3,2,0x00+i,0,1,4,1);
- MB90092_DisChar(3,3,0x0b,0,1,4,1);
- }
- void GetKeyInput(void)
- {
-
- if(EXT==0)
- { delay(1);
- if(EXT==0)
- {
- while (EXT==0);
- MB90092_ClearXY (1,2);
- MB90092_ClearXY (1,3);
- MB90092_ClearXY (1,4);
- KeyFuncIndex=KeyTab[KeyFuncIndex].KeyUpState;
- }
- }
- if(INT==0)
- {
- delay(1);
- if(INT==0)
- {
- while (INT==0);
- MB90092_ClearXY (1,2);
- MB90092_ClearXY (1,3);
- MB90092_ClearXY (1,4);
- KeyFuncIndex=KeyTab[KeyFuncIndex].KeyDnState;
- }
- }
- if(MODE==0)
- {
- delay(1);
- if(MODE==0)
- {
- while (MODE==0);
- MB90092_ClearScreen ();
- KeyFuncIndex=KeyTab[KeyFuncIndex].KeyCrState;
- }
- }
- KeyFuncPtr=KeyTab[KeyFuncIndex].CurrentOperate;
- (*KeyFuncPtr)();
- }
-