📄 a.lst
字号:
C51 COMPILER V7.06 A 02/26/2013 14:52:52 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE A
OBJECT MODULE PLACED IN a.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE a.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include<reg52.h>
2 #define uchar unsigned char
3 #define uint unsigned int
4 sbit motor_output_z=P2^0;
5 sbit motor_output_f=P2^1;
6 sbit key=P2^7;
7 sbit xianwei=P2^2;
8 uchar time_buff;
9 uchar key_time_buff;
10 uint flower_open_time_buff;
11 uint flower_close_time_buff;
12 uchar flag;
13 bit key_up;
14
15 void mcu_init(void)
16 {
17 1 motor_output_z=0;
18 1 motor_output_f=0;
19 1 key=1;
20 1 xianwei=1;
21 1 TMOD=0x01;
22 1 TH0=(65536-5000)/256;
23 1 TL0=(65536-5000)%256;
24 1 TR0=1;
25 1 ET0=1;
26 1 EA=1;
27 1 }
28
29 void key_ord(void)
30 {
31 1 if(key_up==1)
32 1 {
33 2 if(key_time_buff>1)
34 2 {
35 3 key_up=0;
36 3 flag++;
37 3 if(flag>1)
38 3 flag=0;
39 3 }
40 2 }
41 1 }
42
43 void output_cnt(void)
44 {
45 1 if(flag==0)
46 1 {
47 2 flower_open_time_buff=0;
48 2 if(flower_close_time_buff<4000)//20s
49 2 {
50 3 flower_close_time_buff++;
51 3 if(xianwei==0)
52 3 {
53 4 motor_output_z=0;
54 4 motor_output_f=0;
55 4 }
C51 COMPILER V7.06 A 02/26/2013 14:52:52 PAGE 2
56 3 else
57 3 {
58 4 motor_output_z=0;
59 4 motor_output_f=1;
60 4 }
61 3 }
62 2 else
63 2 {
64 3 motor_output_z=0;
65 3 motor_output_f=0;
66 3 }
67 2 }
68 1 if(flag==1)
69 1 {
70 2 flower_close_time_buff=0;
71 2 if(flower_open_time_buff<2000)//10s
72 2 {
73 3 flower_open_time_buff++;
74 3 motor_output_z=1;
75 3 motor_output_f=0;
76 3 }
77 2 else
78 2 {
79 3 motor_output_z=0;
80 3 motor_output_f=0;
81 3 }
82 2 }
83 1 }
84
85 void main(void)
86 {
87 1 mcu_init();
88 1 while(1)
89 1 {;}
90 1 }
91
92 void time_t0(void) interrupt 1
93 {
94 1 TH0=(65536-5000)/256;
95 1 TL0=(65536-5000)%256;
96 1 output_cnt();
97 1 if(time_buff<2)
98 1 {
99 2 time_buff++;
100 2 }
101 1 else
102 1 {
103 2 time_buff=0;
104 2 if(motor_output_z==1||motor_output_f==1)
105 2 {;}
106 2 else
107 2 {
108 3 if(key==0)
109 3 {
110 4 if(key_time_buff<10)
111 4 {
112 5 key_time_buff++;
113 5 }
114 4 }
115 3 else
116 3 {
117 4 key_time_buff=0;
C51 COMPILER V7.06 A 02/26/2013 14:52:52 PAGE 3
118 4 key_up=1;
119 4 }
120 3 key_ord();
121 3 }
122 2 }
123 1 }
124
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 195 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 7 ----
IDATA SIZE = ---- ----
BIT SIZE = 1 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -