📄 inout.lst
字号:
C51 COMPILER V7.01 INOUT 03/08/2007 12:09:38 PAGE 1
C51 COMPILER V7.01, COMPILATION OF MODULE INOUT
OBJECT MODULE PLACED IN inout.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE inout.c OPTIMIZE(7,SPEED) REGFILE(.\fingerPRJ.ORC) BROWSE FLOATFUZZY(0) NOA
-REGS DEBUG OBJECTEXTEND CODE
stmt level source
1 #include "reg58.h"
2 #include "intrins.h"
3
4 #define _INOUT_C_
5 #include "inout.h"
6 #include "bus.h"
7 #include "timer.h"
8 #include "373.h"
9 #include "system.h"
10 #include "sram.h"
11 #include "event.h"
12 #include "define.h"
13 #include "lcd.h"
14 #include "setup.H"
15
16 bit exitfirst,aux1first,aux2first,contactfirst,tamperfirst,duressflag;
17 bit exitlowfirst,aux1lowfirst,aux2lowfirst,contactlowfirst,tamperlowfirst;
18 unsigned char data exitchktimer,aux1chktimer,aux2chktimer,contactchktimer,tamperchktimer;
19 unsigned char data instate,refreshtimer,contactovertimer;//
20
21 //unsigned char xdata tblinout[16][5];
22 /////////////////////////////////////////////////////////////////////////////
23 unsigned char code tblinoutcode[16][5]=
24 {
25 {3,0,0,0,0},
26 {0,3,3,3,3},
27 {0,3,3,3,3},
28 {3,0,3,3,3},
29 {0,99,99,99,99},
30 {3,0,0,0,0},
31 {0,3,0,0,0},
32 {0,3,0,0,0},
33 {0,3,0,0,0},
34 {3,0,0,0,0},
35 {0,3,0,0,0},
36 {0,3,0,0,0},
37 {0,3,0,0,0},
38 {3,3,3,3,3},
39 {0,0,0,0,0},
40 {0,0,0,0,0},
41
42 };
43 /////////////////////////////////////////////////////////////////////////////////
44 void clearoutput()
45 {
46 1 doorunlockflag=0;
47 1 alarmonflag=0;
48 1 ttl1onflag=0;
49 1 ttl2onflag=0;
50 1 beeponflag=0;
51 1
52 1 doorontimer=0;
53 1 alarmontimer=0;
54 1 ttl1ontimer=0;
C51 COMPILER V7.01 INOUT 03/08/2007 12:09:38 PAGE 2
55 1 ttl2ontimer=0;
56 1 beepontimer=0;
57 1
58 1 //clr_373(DOORPORT);
59 1 lockdoor();
60 1 clr_373(ALARMPORT);
61 1 clr_373(TTL1PORT);
62 1 clr_373(TTL2PORT);
63 1 clr_373(BEEPPORT);
64 1
65 1 }
66 /////////////////////////////////////////////////////////////////////////////////
67 void cleariodef()
68 {
69 1 unsigned char i;
70 1 for(i=0;i<80;i++)
71 1 {
72 2 ram_writep0(i,*(tblinoutcode[0]+i));
73 2 }
74 1 }
75 /////////////////////////////////////////////////////////////////////////////////
76 void exitchk()
77 {
78 1 if(!EXIT)
79 1 {
80 2 if(!exitfirst)exitlowfirst=0;
81 2 else
82 2 {
83 3 if(exitlowfirst)
84 3 {
85 4 exitlowfirst=0;
86 4 exitchktimer=timerl;
87 4 }
88 3 else
89 3 {
90 4 if((timerl-exitchktimer)<TEXITDELAYTIME)return;
91 4 exitfirst=0;
92 4 //here add the code when exit button is pressed
93 4 instate|=bittbl[EXITCOUNT];
94 4 if(setflag)return;
95 4
96 4 accessevent(EVENTINPUT|MESSAGEEXIT);
97 4 }
98 3 }
99 2 }
100 1 else
101 1 {
102 2 if(exitfirst)exitlowfirst=1;
103 2 else
104 2 {
105 3 //if(exitlowfirst) //051126
106 3 if(!exitlowfirst) //051126
107 3 {
108 4 exitlowfirst=1;
109 4 exitchktimer=timerl;
110 4 }
111 3 else
112 3 {
113 4 if((timerl-exitchktimer)<TEXITDELAYTIME)return;
114 4 exitfirst=1;
115 4 instate&=~bittbl[EXITCOUNT];
116 4 }
C51 COMPILER V7.01 INOUT 03/08/2007 12:09:38 PAGE 3
117 3 }
118 2 }
119 1 }
120 /////////////////////////////////////////////////////////////////
121 void aux1chk()
122 {
123 1 if(!AUX1)
124 1 {
125 2 if(!aux1first)aux1lowfirst=0;
126 2 else
127 2 {
128 3 if(aux1lowfirst)
129 3 {
130 4 aux1lowfirst=0;
131 4 aux1chktimer=timerl;
132 4 }
133 3 else
134 3 {
135 4 if((timerl-aux1chktimer)<TAUX1DELAYTIME)return;
136 4 aux1first=0;
137 4 instate|=bittbl[AUX1COUNT];
138 4 if(setflag)return;
139 4
140 4 accessevent(EVENTINPUT|MESSAGEAUX1);
141 4
142 4
143 4 }
144 3 }
145 2 }
146 1 else
147 1 {
148 2 if(aux1first)aux1lowfirst=1;
149 2 else
150 2 {
151 3 //if(aux1lowfirst) //051126
152 3 if(!aux1lowfirst) //051126
153 3 {
154 4 aux1lowfirst=1;
155 4 aux1chktimer=timerl;
156 4 }
157 3 else
158 3 {
159 4 if((timerl-aux1chktimer)<TAUX1DELAYTIME)return;
160 4 aux1first=1;
161 4 instate&=~bittbl[AUX1COUNT];
162 4 }
163 3 }
164 2 }
165 1
166 1 }
167 /////////////////////////////////////////////////////////////////////////////
168 void aux2chk()
169 {
170 1 if(!AUX2)
171 1 {
172 2 if(!aux2first)aux2lowfirst=0;
173 2 else
174 2 {
175 3 if(aux2lowfirst)
176 3 {
177 4 aux2lowfirst=0;
178 4 aux2chktimer=timerl;
C51 COMPILER V7.01 INOUT 03/08/2007 12:09:38 PAGE 4
179 4 }
180 3 else
181 3 {
182 4 if((timerl-aux2chktimer)<TAUX2DELAYTIME)return;
183 4 aux2first=0;
184 4 instate|=bittbl[AUX2COUNT];
185 4 if(setflag)return;
186 4
187 4 accessevent(EVENTINPUT|MESSAGEAUX2);
188 4
189 4 }
190 3 }
191 2 }
192 1 else
193 1 {
194 2 if(aux2first)aux2lowfirst=1;
195 2 else
196 2 {
197 3 //if(aux2lowfirst) //051126
198 3 if(!aux2lowfirst) //051126
199 3
200 3 {
201 4 aux2lowfirst=1;
202 4 aux2chktimer=timerl;
203 4 }
204 3 else
205 3 {
206 4 if((timerl-aux2chktimer)<TAUX2DELAYTIME)return;
207 4 aux2first=1;
208 4 instate&=~bittbl[AUX2COUNT];
209 4 }
210 3 }
211 2 }
212 1
213 1 }
214 /////////////////////////////////////////////////////////////////////////////
215 void contactchk()
216 {
217 1 if(!CONTACT)
218 1 {
219 2 if(!contactfirst)contactlowfirst=0;
220 2 else
221 2 {
222 3 if(contactlowfirst)
223 3 {
224 4 contactlowfirst=0;
225 4 contactchktimer=timerl;
226 4 }
227 3 else
228 3 {
229 4 if((timerl-contactchktimer)<TCONTACTDELAYTIME)return;
230 4 contactfirst=0;
231 4 instate|=bittbl[CONTACTCOUNT];
232 4
233 4 if(setflag)
234 4 {
235 5
236 5 contactovertimer=100;
237 5 return;
238 5 }
239 4 if(!doorunlockflag)
240 4 {
C51 COMPILER V7.01 INOUT 03/08/2007 12:09:38 PAGE 5
241 5 accessevent(EVENTINPUT|MESSAGECONTACT);
242 5 contactovertimer=20;
243 5 }
244 4 else
245 4 {
246 5 contactovertimer=100;
247 5 }
248 4
249 4 }
250 3 }
251 2 }
252 1 else
253 1 {
254 2 if(contactfirst)contactlowfirst=1;
255 2 else
256 2 {
257 3 //if(contactlowfirst) //051126
258 3 if(!contactlowfirst) //051126
259 3 {
260 4 contactlowfirst=1;
261 4 contactchktimer=timerl;
262 4 }
263 3 else
264 3 {
265 4 if((timerl-contactchktimer)<TCONTACTDELAYTIME)return;
266 4 contactfirst=1;
267 4 instate&=~bittbl[CONTACTCOUNT];
268 4
269 4 if(!beeponflag)clr_373(BEEPPORT);
270 4
271 4 accessevent(EVENTINPUT|MESSAGEDOORCLOSED);
272 4 }
273 3 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -