📄 menu.lst
字号:
C51 COMPILER V7.06 MENU 08/03/2007 11:00:55 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE MENU
OBJECT MODULE PLACED IN menu.OBJ
COMPILER INVOKED BY: D:\Keil 51\setup\C51\BIN\C51.EXE menu.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 /**********************************多级菜单LCD显示********************************************/
2 /*********作者:王胜文。QQ:95201972 email:nunk@163.com 希望与大家交流2007。08。03**********/
3
4
5 #include<reg51.h>
6 #include<drive_functions.h>
7 #include<get_keys.h>
8 #include<characters.h>
9 #include<menu_functions.h>
*** WARNING C275 IN LINE 1056 OF MENU_FUNCTIONS.H: expression with possibly no effect
10 void (*current_operation_index)();//
11 uchar func_index=0;
12 uchar func_index;
13
14 typedef struct
15 {
16 uchar current;
17 uchar up;
18 uchar down;
19 uchar enter;
20 void (*current_operation)();
21 } key_table;
22
23 key_table code table[28]=
24 {
25 {0,24,8,1,(*fun0)}, //0//第一层,显示[贵州],四川,广东,返回
26 {1,7,3,2,(*fun1)},//1-0按回车,进第二层,显示[贵阳],刘盘水,黄平,返回
27 {2,2,2,1,(*fun2)},//2-1 >enter>guiyang is the capital of guizhou,[return]
28
29 {3,1,5,4,(*fun4)},//4-1向下,显示贵阳,[六盘水],黄平,返回
30 {4,4,4,3,(*fun5)},//5-4 >enter>liupanshui is a base of coal mine of southern of china
31
32 {5,3,7,6,(*fun7)},//7-4向下,显示贵阳,六盘水,[黄平],返回
33 {6,6,6,5,(*fun8)}, //8-7 >enter>huangping is my hometown,[return]
34
35 {7,5,1,0,(*fun10)},//10-7 >down>贵阳,六盘水,黄平,[返回][
36
37 {8,0,16,9,(*fun12)},//12-0 >down>贵州,[四川],广东,返回
38 {9,15,11,10,(*fun13)},//13-12 >enter>[成都],绵阳,乐山,返回
39 {10,10,10,9,(*fun14)},//14-13 >entern>chengdu is the capital of sichuan province,[return]
40
41 {11,9,13,12,(*fun16)},//16-13 >down>成都,[绵阳],乐山,返回
42 {12,12,12,11,(*fun17)},//17-16 >enter>miangyang is a technology city of western china,[return]
43
44 {13,11,15,14,(*fun19)},//19-16 >down>成都,绵阳,[乐山],返回
45 {14,14,14,13,(*fun20)},//20-19 >enter>leshan have leshan dafu,[return]
46
47 {15,13,9,8,(*fun22)},//22-19 >down>成都,绵阳,乐山,[返回]
48
49 {16,8,24,17,(*fun24)},//24-12 >down>贵州,四川,[广东],返回
50 {17,23,19,18,(*fun25)},//25-24 >enter>[深圳],广州,惠州,返回
51 {18,18,18,17,(*fun26)},//26-25 >enter>i'm now in shenzhen,[return]
52
53 {19,17,21,20,(*fun28)},//28-25 >down>深圳,[广州],惠州,返回
54 {20,20,20,19,(*fun29)}, //29-28 >enter>guangzhou is the capital of guangdong,return
C51 COMPILER V7.06 MENU 08/03/2007 11:00:55 PAGE 2
55
56 {21,19,23,22,(*fun31)},//31-28 >down>深圳,广州,[惠州],返回
57 {22,22,22,21,(*fun32)},//32-31 >enter>i'm in huizhou in 1997,[return]
58
59 {23,21,17,16,(*fun34)},//34-31 >down>深圳,广州,惠州,[返回]
60
61 {24,16,0,25,(*fun36)},//36-24 >down>贵州,四川,广东,[返回]
62 {25,26,26,27,(*fun37)},//37-36 >enter>[关闭],重启
63 {26,25,25,0,(*fun38)}, //38-37 >up>关闭,[重启]
64 {27,27,27,27,(*fun39)}//shutdown
65
66 };
67
68
69
70 void main(void)
71 {
72 1
73 1
74 1 while(1)
75 1 {
76 2 if(CheckState()) //检查是否有键按下
77 2 {
78 3 delay(); //延时去抖动
79 3
80 3 if(CheckState())
81 3 {
82 4 key=GetKeys(); //读取键盘值
83 4
84 4
85 4 /*******************find index****************************/
86 4 switch(key)
87 4 {
88 5 case 0x14:
89 5 func_index=table[func_index].up; //向上翻
90 5 break;
91 5 case 0x24:
92 5 func_index=table[func_index].enter;//回车
93 5 break;
94 5 case 0x44:
95 5 func_index=table[func_index].down;//向下翻
96 5 break;
97 5 default:
98 5 break;
99 5
100 5 }
101 4 }
102 3 ClearLCD(); //清屏
103 3 }
104 2
105 2
106 2 current_operation_index=table[func_index].current_operation;
107 2 fun40();//显示左屏固定信息
108 2 (*current_operation_index)();//执行当前操作函数
109 2 }
110 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 5069 ----
CONSTANT SIZE = 4004 ----
XDATA SIZE = ---- ----
C51 COMPILER V7.06 MENU 08/03/2007 11:00:55 PAGE 3
PDATA SIZE = ---- ----
DATA SIZE = 11 4
IDATA SIZE = ---- ----
BIT SIZE = 3 1
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -