📄 main1_1.lst
字号:
C51 COMPILER V7.06 MAIN1_1 09/23/2005 08:16:18 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE MAIN1_1
OBJECT MODULE PLACED IN E:\NEWMAC~1\050808\MAIN\MAIN1_1.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE E:\NEWMAC~1\050808\MAIN\MAIN1_1.C DB SB OE
stmt level source
1 //#pragma la
2 #include <main1.h>
3 #define uchar unsigned char
4 #define uint unsigned int
5 sbit stop=P3^5;
6
7 xdata uchar sbuffer[5],rbuffer[64],sbuffer1[55];
8 uchar S_ANSW,R_ANSW,POINTER0,POINTER1,RSUM,SSUM,c_t1,s_byte_nums,r_byte_nums,
9 work,pn1,PRG,err,toPRG,temp_c;
10 bit edit_finish,copy,change_prg,overtime,getPRG,received,send,t31OK,t41OK,
11 t51OK,resend,ans,s_p,noans_ok,connect,break_connect,main1_err,in_sector,
12 editing,p_received,lift_ok,pc_ok,need_para,temp_motor_stop,p_forbid,rc_forbid,
13 new_switch1,new_switch2,new_switch3,
14 urgent_stop,p_active,rc_active;
15 uint *point;
16
17 xdata uchar start _at_ 0x0800;
18 xdata uchar start_again _at_ 0x0801;
19 xdata uchar decrease _at_ 0x0802;
20 xdata uchar err_ok _at_ 0x0804;
21 xdata uchar YOUHU _at_ 0x0806;
22 xdata uchar WIRE _at_ 0x0808;
23 xdata uchar decrease_ok _at_ 0x080A;
24 xdata uchar weld_switch _at_ 0x080C;
25 xdata uchar wire_switch _at_ 0x080E;
26 xdata uchar current_add _at_ 0x0810;
27 xdata uchar current_dec _at_ 0x0812;
28 xdata uchar rot_front _at_ 0x0814;
29 xdata uchar rot_reverse _at_ 0x0816;
30 xdata uchar wire_add _at_ 0x0818;
31 xdata uchar wire_dec _at_ 0x081A;
32 xdata uchar osc_l _at_ 0x081C;
33 xdata uchar osc_r _at_ 0x081E;
34 xdata uchar breadth_add _at_ 0x0820;
35 xdata uchar breadth_dec _at_ 0x0822;
36 xdata uchar avc_up _at_ 0x0824;
37 xdata uchar avc_down _at_ 0x0826;
38 xdata uchar motor_stop _at_ 0x0828;
39 xdata uchar delt_switch _at_ 0x082A;
40 xdata uchar return_ok _at_ 0x082C;
41 xdata uchar nonce_sec _at_ 0X082E;
42 xdata uint FINISH _at_ 0X0830;
43 xdata uint CURRENT _at_ 0X0832;
44 xdata uint VOLTAGE _at_ 0X0834;
45 xdata uint AVC _at_ 0X0836;
46 //xdata uchar pc_ok _at_ 0x0838;
47 xdata uchar new_switch11 _at_ 0x0839;
48 xdata uchar new_switch22 _at_ 0x083A;
49 xdata uchar p_forbided _at_ 0x083B;
50 xdata uchar rc_forbided _at_ 0x083C;
51 xdata uchar p_actived _at_ 0x083D;
52 xdata uchar rc_actived _at_ 0x083E;
53 xdata uint last_FINISH _at_ 0x0840;
54 xdata uchar pc_stop _at_ 0x0842;
55
C51 COMPILER V7.06 MAIN1_1 09/23/2005 08:16:18 PAGE 2
56 void TR_noans()
57 {
58 1 REN=0;
59 1 noans_ok=0;
60 1 // TB8=1;
61 1 POINTER0=0;
62 1 SSUM=0;
63 1 send=1;
64 1 c_t1=0;
65 1 TR1=1;
66 1 while(POINTER0<s_byte_nums);
67 1 TR1=0;
68 1 noans_ok=1;
69 1 REN=1;
70 1 }
71
72 void TR_ans()
73 {
74 1 REN=0;
75 1 ans=1;
76 1 POINTER1=0;
77 1 RSUM=0;
78 1 TB8=1;
79 1 POINTER0=0;
80 1 SSUM=0;
81 1 send=1;
82 1 c_t1=0;
83 1 TR1=1;
84 1 while(POINTER0<s_byte_nums);
85 1 TR1=0;
86 1
87 1 REN=1;
88 1 send=0;
89 1 c_t1=0;
90 1 // TR1=1;
91 1 while(POINTER1<r_byte_nums&&overtime==0);
92 1 TR1=0;
93 1 POINTER1=0;
94 1 RSUM=0;
95 1 if(overtime==1)
96 1 {
97 2 err=3;
98 2 main1_err=1;
99 2 overtime=0;
100 2 stop=0;
101 2 }
102 1 ans=0;
103 1 REN=0;
104 1 }
105
106 void ini_sbuf(unsigned char a,b,c,d,e)
107 {
108 1 sbuffer[0]=a;
109 1 sbuffer[1]=b;
110 1 sbuffer[2]=c;
111 1 sbuffer[3]=d;
112 1 sbuffer[4]=e;
113 1 }
114
115 unsigned char get_byte_nums(unsigned char type)
116 {
117 1 unsigned char numbers;
C51 COMPILER V7.06 MAIN1_1 09/23/2005 08:16:18 PAGE 3
118 1 switch(type)
119 1 {
120 2 case command:
121 2 case program:
122 2 case answer: numbers=4;
123 2 break;
124 2 case err_infor:
125 2 case parameter1: numbers=5;
126 2 break;
127 2 case parameter:
128 2 case infor: numbers=6;
129 2 break;
130 2 case parameter2: numbers=7;
131 2 break;
132 2 case call_result: numbers=9;
133 2 break;
134 2 case para_pc: numbers=10;
135 2 break;
136 2 case p_out_sec: numbers=55;
137 2 break;
138 2 case p_in_sec: numbers=24;
139 2 break;
140 2 case edit_sec: numbers=64;
141 2 break;
142 2 default: break;
143 2 }
144 1 return numbers;
145 1 }
146
147 void com_type()
148 {
149 1 switch(rbuffer[2])
150 1 {
151 2 case com_edit: editing=1;break;
152 2
153 2 case com_efinish: editing=0;
154 2 edit_finish=1;break;
155 2
156 2 case com_start: if(start==0)
157 2 start=1;break;
158 2 case com_start_again: if(start==0)
159 2 {
160 3 start=1;
161 3 start_again=1;
162 3 }break;
163 2 case com_decrease: decrease=1;break; //手动衰减
164 2 case com_current_add: current_add=1;break; //电流加
165 2 case com_current_dec: current_dec=1;break; //电流减
166 2 case com_rot_front: rot_front=1;break;
167 2 case com_rot_reverse: rot_reverse=1;break;
168 2 case com_wire_add: wire_add=1;break;
169 2 case com_wire_dec: wire_dec=1;break;
170 2 case com_osc_l: osc_l=1;break;
171 2 case com_osc_r: osc_r=1;break;
172 2 case com_breadth_add: breadth_add=1;break;
173 2 case com_breadth_dec: breadth_dec=1;break;
174 2 case com_avc_up: avc_up=1;break;
175 2 case com_avc_down: avc_down=1;break;
176 2 case com_motor_stop: temp_motor_stop=1;break;
177 2 case com_urgent_stop: {
178 3 pc_stop=1;
179 3 urgent_stop=1;
C51 COMPILER V7.06 MAIN1_1 09/23/2005 08:16:18 PAGE 4
180 3 err=1;
181 3 err_ok=0;
182 3 }break;
183 2 case com_connect: connect=1;break;
184 2 case com_connect_fail: break_connect=1;break;
185 2 case com_forbid_p: p_forbid=1;break;
186 2 case com_forbid_rc: rc_forbid=1;break;
187 2 case com_p_active: p_active=1;break;
188 2 case com_rc_active: rc_active=1;break;
189 2 case com_need_para: need_para=1;break;
190 2 default: break;
191 2 }
192 1 if(ans==0)
193 1 {
194 2 POINTER1=0;
195 2 RSUM=0;
196 2 r_byte_nums=4;
197 2 }
198 1
199 1 }
200
201 void data_type() //对接收到的数据分辨类型
202 {
203 1 switch(rbuffer[1])
204 1 {
205 2 case command: com_type();break;
206 2 case answer: R_ANSW=rbuffer[2];break;
207 2 case err_infor: err=rbuffer[3];break;
208 2 /*
209 2 case infor_sec: {
210 2 nonce_sec=rbuffer[2];
211 2
212 2 }break;
213 2 */
214 2 case edit_sec: {
215 3 // if(in_sector==0)
216 3 // {
217 3 // nonce_sec=rbuffer[2];
218 3 // in_sector=1;
219 3 // }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -