📄 main.lst
字号:
C51 COMPILER V7.07 MAIN 09/10/2005 11:32:44 PAGE 1
C51 COMPILER V7.07, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN Main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Main.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1
2 /*****************************/
3 /* include files */
4 /*****************************/
5 #include "define.h"
6 #include "cpu8052.h"
7 #include "global.h"
8 #include "delay.h"
9 #include "S6B33B0A.h"
10 #include "poweron.h"
11 #include "S6b07x.h"
12
13 #include <intrins.h>
14
15 void SubRoutine11(void);
16 void SubRoutine22(void);
17 void SubRoutine33(void);
18
19 unsigned char idata M_Contrast;
20 unsigned char idata S_Contrast;
21 unsigned char idata N_Line;
22 /*****************************/
23
24 //One interrupt
25 void Power_Off(void) interrupt 2
26 {
27 1
28 1 EX1 = 0; //disable int0
29 1
30 1 while(DISPOFF==0 )
31 1 {
32 2 Main_Off();
33 2 Sub_Off();
34 2 DelayX10ms(1);
35 2 RES=0;
36 2 DelayX10ms(10);
37 2 P0=0;
38 2 P2=0;
39 2 POWER=1; //power off
40 2
41 2 }
42 1
43 1 EX1 = 1; //enable next interrupt
44 1 IE1 = 0; //set TCON.3 flag
45 1
46 1 }
47
48 /*****************************/
49 //More interrupt
50 void Adj(void) interrupt 0
51 {
52 1 EX0 = 0;
53 1
54 1 while(STOP==0 )
55 1 {
C51 COMPILER V7.07 MAIN 09/10/2005 11:32:44 PAGE 2
56 2
57 2 if ( UP==0 & ALT==1 ) //interrupt 1
58 2 {
59 3 M_Contrast++;
60 3 M_Contrast=M_Contrast&0xff;
61 3 Set_Contrast(M_Contrast);
62 3 LcdSub_ShowNum(M_Contrast);
63 3 DelayX10ms(50);
64 3 }
65 2 if ( DOWN==0 & ALT==1 ) //interrupt 2
66 2 {
67 3 M_Contrast--;
68 3 M_Contrast=M_Contrast&0xff;
69 3 Set_Contrast(M_Contrast);
70 3 LcdSub_ShowNum(M_Contrast);
71 3 DelayX10ms(50);
72 3 }
73 2
74 2 if ( UP==0 & ALT==0 ) //interrupt 1
75 2 {
76 3
77 3 // N_Line++;
78 3 // Set_NLine(N_Line);
79 3 // LcdSub_ShowNum(N_Line);
80 3 S_Contrast++;
81 3 S_Contrast=S_Contrast&0x3f;
82 3 LcdSub_Contrast(S_Contrast);
83 3 DelayX10ms(50);
84 3 }
85 2 if ( DOWN==0 & ALT==0 ) //interrupt 2
86 2 {
87 3
88 3 // N_Line--;
89 3 // Set_NLine(N_Line);
90 3 // LcdSub_ShowNum(N_Line);
91 3
92 3 S_Contrast--;
93 3 S_Contrast=S_Contrast&0x3f;
94 3 LcdSub_Contrast(S_Contrast);
95 3 DelayX10ms(50);
96 3 }
97 2
98 2
99 2 }
100 1 EX0 = 1;
101 1 IE0 = 0; //set TCON.1 flag
102 1 }
103
104 /*****************************/
105
106
107
108
109 //program start from main( ) while power on
110 void Main(void)
111 {
112 1
113 1 PowerOnInitial();
114 1
115 1 POWER=0; //power on
116 1 DelayX10ms(10);
117 1
C51 COMPILER V7.07 MAIN 09/10/2005 11:32:44 PAGE 3
118 1 RES=0;
119 1 DelayX10ms(1);
120 1 RES=1;
121 1 DelayX10ms(10);
122 1
123 1 // M_Contrast=150;
124 1 M_Contrast=214;
125 1 // M_Contrast=100;
126 1
127 1 N_Line=13;
128 1
129 1 S_Contrast=32;
130 1 CS2 = 1;
131 1 Initalize(M_Contrast);
132 1 CS1 = 1;
133 1 Sub_Initalize(S_Contrast);
134 1
135 1
136 1 while( 1 )
137 1 {
138 2
139 2
140 2 SubRoutine11( );
141 2
142 2 SubRoutine22( );
143 2
144 2 SubRoutine33( );
145 2
146 2
147 2 }
148 1 }
149
150
151 void SubRoutine11(void)
152 {
153 1
154 1 int i;
155 1 i=0;
156 1
157 1 CS2 = 1;
158 1 LcdMain_Select(i);
159 1 CS1 = 1;
160 1 LcdSub_Select(i);
161 1
162 1 while( (DOWN==1)|(UP==1))
163 1 {
164 2
165 2 if (ALT==1)
166 2
167 2 {
168 3
169 3 if ( DOWN==0)
170 3 {
171 4 i--;
172 4 CS2 = 1;
173 4 LcdMain_Select(i);
174 4 CS1 = 1;
175 4 LcdSub_Select(i);
176 4 DelayX10ms(10);
177 4 }
178 3
179 3 if ( UP==0 )
C51 COMPILER V7.07 MAIN 09/10/2005 11:32:44 PAGE 4
180 3 {
181 4 i++;
182 4 CS2 = 1;
183 4 LcdMain_Select(i);
184 4 CS1 = 1;
185 4 LcdSub_Select(i);
186 4 DelayX10ms(10);
187 4 }
188 3
189 3
190 3 }
191 2
192 2 else
193 2 {
194 3 CS2 = 1;
195 3 LcdMain_Select(i);
196 3 CS1 = 1;
197 3 LcdSub_Select(i);
198 3 DelayX10ms(150);
199 3 i++;
200 3 }
201 2
202 2 if ( i>21)
203 2 {
204 3 i=0;
205 3 }
206 2
207 2 if (i<0)
208 2 {
209 3 i=21;
210 3 }
211 2
212 2
213 2 } // end while
214 1 }
215
216
217 void SubRoutine22(void)
218 {
219 1 int i,j;
220 1 CS2 = HI;
221 1 Grid(0,127,0,159,0xff,0xff);
222 1
223 1 for(j=0; j<10; j++)
224 1 {
225 2 for(i=0; i<6; i++)
226 2 {
227 3 Dot16x16((i*16+16),(j*16),j,0x0000,0xffff);
228 3 }
229 2 }
230 1
231 1 j=5;
232 1 while(ALT==1)
233 1 {
234 2
235 2 for(i=0; i<6; i++)
236 2 {
237 3 Dot16x16((i*16+16),(j*16),j,0xffff,0x0000);
238 3 }
239 2
240 2 DelayX10ms(10);
241 2
C51 COMPILER V7.07 MAIN 09/10/2005 11:32:44 PAGE 5
242 2 if ( UP==0 )
243 2 {
244 3
245 3 for(i=0; i<6; i++)
246 3 {
247 4 Dot16x16((i*16+16),(j*16),j,0x0000,0xffff);
248 4 }
249 3 DelayX10ms(30);
250 3 j++ ;
251 3
252 3 if ( j>=10)
253 3 {
254 4 j=0;
255 4 }
256 3
257 3
258 3
259 3 }
260 2
261 2 if ( DOWN==0)
262 2 {
263 3
264 3 for(i=0; i<6; i++)
265 3 {
266 4 Dot16x16((i*16+16),(j*16),j,0x0000,0xffff);
267 4 }
268 3 DelayX10ms(30);
269 3 j--;
270 3
271 3 if (j<0)
272 3 {
273 4 j=9;
274 4 }
275 3
276 3
277 3
278 3 } //
279 2
280 2 } // end while
281 1
282 1 DelayX10ms(30);
283 1
284 1 }
285
286
287
288
289 void SubRoutine33(void)
290 {
291 1
292 1 int x,y;
293 1 x=0;
294 1 y=0;
295 1 CS2 = HI;
296 1 // Grid(0,127,0,159,0xff,0xff);
297 1 Grid(0,127,0,159,0x57,0xEA);
298 1 DelayX10ms(10);
299 1 while (ALT==1 )
300 1 {
301 2
302 2 if ( UP==0 )
303 2 {
C51 COMPILER V7.07 MAIN 09/10/2005 11:32:44 PAGE 6
304 3 // Grid(10,120,y,y+20,0xff,0xff);
305 3 Grid(10,120,y,y+20,0x57,0xEA);
306 3 y=y+20;
307 3 if ( y > 140 )
308 3 {
309 4 y=0;
310 4 }
311 3
312 3 DelayX10ms(10);
313 3 }
314 2 if ( DOWN==0)
315 2 {
316 3
317 3 // Grid(10,120,y,y+20,0xff,0xff);
318 3 Grid(10,120,y,y+20,0x57,0xEA);
319 3 y=y-20;
320 3
321 3 if ( y < 0 )
322 3 {
323 4 y=0;
324 4 y=139;
325 4 }
326 3 DelayX10ms(10);
327 3
328 3 }
329 2 Grid(10,120,y,y+20,0x21,0x04);
330 2 // DelayX10ms(60);
331 2 }
332 1
333 1
334 1
335 1
336 1 }
337
338
339
340
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1129 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 10
IDATA SIZE = 3 ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -