📄 c51.lst
字号:
C51 COMPILER V7.06 C51 07/02/2008 10:57:46 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE C51
OBJECT MODULE PLACED IN C51.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE C51.C BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include <reg51.h>
2 #include <intrins.h>
3 #include <absacc.h>
4 #include "adc0831.h"
5 #include "Serialint.h"
6 #include "LCD7565R.h"
7 #define uchar unsigned char
8 #define uint unsigned int
9 uchar starttime[6]={0x08,0x0a,0x16,0x1e,0x00,0x02};
10 uchar sec100=0;sec=0,hour=0;
11
12 uchar Watertemp[4]={0x50,0x32,0x00,0x0a};
13 uchar codews,hotws,codewd,hotwd;
14 uchar WTFLG=0,keyvalue=0;
15 //void Watertset();
16 //uchar idata disbuff[16];
17 sbit key1= P3^2;
18 sbit key2= P3^3;
19 sbit key3= P3^4;
20 sbit key4= P3^5;
21
22 void PanduanFlage0(uchar f)
23 {
24 1 if(ID==f) Fx_flage=0;
25 1 else Fx_flage=1;
26 1 }
27
28
29 void Mnue()
30 {
31 1 PanduanFlage0(0);
32 1 disp_str("进行A/D转换",0,0);
33 1 PanduanFlage0(1);
34 1 disp_str("进行串口通讯",0,2);
35 1 PanduanFlage0(2);
36 1 disp_str("温度设置",0,4);
37 1 PanduanFlage0(3);
38 1 disp_str("香水喷洒时间设置",0,6);
39 1 //disp_str("密码设置",0,6);
40 1 }
41
42
43 void Mnue0()
44 { EA=0;
45 1 Clear();
46 1 disp_str("退出",102,6);
47 1 while (key3==1)
48 1 ADchange();
49 1 Clear();
50 1 Mnue();
51 1 EA=1;
52 1 }
53
54 void Mnue1()
55 {
C51 COMPILER V7.06 C51 07/02/2008 10:57:46 PAGE 2
56 1 EA=0;
57 1 Clear();
58 1 Serialint();
59 1 disp_str("进行串口通讯",15,0);
60 1 disp_str("退出",102,6);
61 1 while (key3==1)
62 1 {
63 2 disp_str("AB123",20,3);
64 2 send_string_com("123AB",16);
65 2 send_char_com(0x0d);
66 2 send_char_com(0x0a);
67 2 }
68 1 Clear();
69 1 Mnue();
70 1 EA=1;
71 1 }
72
73
74 /************************water set progremm****************/
75 void dispwatert(uchar wt,xl,yl)
76 {
77 1 b1 = wt/100+48;
78 1 b2 = (wt%100)/10+48;
79 1 b3 = (wt%100)%10+48;
80 1 if(b1==48 && xl==112)
81 1 {
82 2 disp_ch(b2,xl,yl);
83 2 disp_ch(b3,xl+8,yl);
84 2 }
85 1
86 1 if(xl==25)
87 1 {
88 2 if(b1==48)
89 2 {
90 3 disp_ch(b2,xl,yl);
91 3 disp_ch(b3,xl+8,yl);
92 3 Fx_flage=1;
93 3 disp_ch(32,xl+16,yl);
94 3 }
95 2 else
96 2 {
97 3 disp_ch(b1,xl,yl);
98 3 disp_ch(b2,xl+8,yl);
99 3 disp_ch(b3,xl+16,yl);
100 3 }
101 2 }
102 1 }
103
104
105
106 void Watertfset(uchar f)
107 {
108 1 if(f==WTFLG) Fx_flage=0;
109 1 else Fx_flage=1;
110 1 }
111
112 void Watertset()
113 {
114 1 Watertfset(0);
115 1 dispwatert(hotws,25,2);
116 1 Watertfset(1);
117 1 dispwatert(hotwd,25,4);
C51 COMPILER V7.06 C51 07/02/2008 10:57:46 PAGE 3
118 1
119 1 Watertfset(2);
120 1 dispwatert(codews,112,2);
121 1 Watertfset(3);
122 1 dispwatert(codewd,112,4);
123 1
124 1 Watertfset(4);
125 1 disp_str("保存",24,6);
126 1 Watertfset(5);
127 1 disp_str("退出",74,6);
128 1
129 1 }
130
131
132
133 void keyscan(uchar keyv,full)
134 {
135 1 keyvalue=keyv;
136 1 while(key4==1)
137 1 {
138 2 Watertset();
139 2 if(key1==0)
140 2 {
141 3 while(key1==0);
142 3 if(keyvalue<full) keyvalue++;
143 3 else keyvalue=0;
144 3 }
145 2 if(key2==0)
146 2 {
147 3 while(key2==0);
148 3 if(keyvalue>0) keyvalue--;
149 3 else keyvalue=full;
150 3 }
151 2
152 2 if(full==6)
153 2 WTFLG=keyvalue;
154 2 else
155 2 switch(WTFLG)
156 2 {
157 3 case 0: hotws=keyvalue;break;
158 3 case 1: hotwd=keyvalue; break;
159 3 case 2: codews=keyvalue;break;
160 3 case 3: codewd=keyvalue;break;
161 3 }
162 2
163 2 // Watertset();
164 2 }
165 1 while(key4==0);
166 1 }
167
168
169
170
171 void Mnue2()
172 { //uchar d1=0;
173 1 EA=0;
174 1 Clear();
175 1 WTFLG=0;
176 1 Fx_flage=1;
177 1 hotws= Watertemp[0];hotwd=Watertemp[1];
178 1 codews=Watertemp[2];codewd=Watertemp[3];
179 1 disp_str("热水",8,0);
C51 COMPILER V7.06 C51 07/02/2008 10:57:46 PAGE 4
180 1 disp_str("设置",0,2);
181 1 disp_str("当前",0,4);
182 1
183 1 disp_str("冷水",96,0);
184 1 disp_str("设置",80,2);
185 1 disp_str("当前",80,4);
186 1 disp_ch(45,104,2);
187 1 disp_ch(45,104,4);
188 1 Watertset();
189 1 while (key3==1)
190 1 {
191 2 Watertset();
192 2 keyscan(WTFLG,6);
193 2 switch(WTFLG)
194 2 {
195 3 case 0:
196 3 keyscan(hotws,100);
197 3 break;
198 3 case 1:
199 3 keyscan(hotwd,100);
200 3 break;
201 3
202 3 case 2:
203 3 keyscan(codews,100);
204 3 break;
205 3 case 3:
206 3 keyscan(codewd,100);
207 3 break;
208 3
209 3 case 4:
210 3 Watertemp[0]=hotws;Watertemp[1]=hotwd;
211 3 Watertemp[2]=codews;Watertemp[3]=codewd;
212 3 goto waterover;
213 3
214 3 case 5: goto waterover;
215 3 // default: break;
216 3 }
217 2 while(key4==0);
218 2 }
219 1 waterover:
220 1 Clear();
221 1 Mnue();
222 1 EA=1;
223 1 }
224
225 /*******************************////////////////////////
226
227
228
229 void disptime(uchar f)
230 {
231 1
232 1 if(f==1) Fx_flage=0;
233 1 else Fx_flage=1;
234 1 b1 = hour/10+48;
235 1 b2 = hour%10+48;
236 1 disp_ch(b1,40,4);
237 1 disp_ch(b2,48,4);
238 1
239 1 if(f==0) Fx_flage=0;
240 1 else Fx_flage=1;
241 1 b1 = sec/10+48;
C51 COMPILER V7.06 C51 07/02/2008 10:57:46 PAGE 5
242 1 b2 = sec%10+48;
243 1 disp_ch(b1,64,4);
244 1 disp_ch(b2,72,4);
245 1 }
246
247
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -