📄 ir.lst
字号:
145 1 TA = 0x55;
146 1 WDCON = 0xC3;//init watchdog timer
147 1
148 1 TMOD |= 0x02;//timer0,auto reload, IR 1000/38=26.3us
149 1 //osc/12 = 5MHz, unit = 200ns; count = 132 = 0x84
150 1 //TH0 = 0x100 - 0x84 = 0x7C;
151 1 TH0 = TIMER0_RELOAD;
152 1 TL0 = TIMER0_RELOAD;
153 1 #ifndef IR38KHz
TR0 = 1;
ET0 = 1;
#endif
157 1
158 1 TMOD |= 0x20;//timer1,auto load,baud rate generation
159 1 TH1 = 0xe8;
160 1 TL1 = 0xe8;
161 1 SCON = 0x50;
162 1 PCON = 0x80;
163 1 TR1 = 1;
164 1 //ET1 = 1;
165 1 ES0 = 1;
166 1
167 1 //T2CON |= 0x00;//timer2,timer
168 1 TH2 = 0x3c;
169 1 TL2 = 0xaf;
170 1 TR2 = 1;
171 1 ET2 =1;
172 1
173 1 //IT1 = 1;//MAC interrupt
174 1 //EX1 = 1;
175 1 #ifdef IR38KHz
176 1 IT0 = 1;//IR interrupt,falling edge
177 1 //EX0 = 1;
178 1 #endif
179 1
C51 COMPILER V7.06 IR 10/10/2003 10:51:50 PAGE 4
180 1 //IP = 0x01; //INT0 higher
181 1 //IP = 0x04; //INT1 higher
182 1
183 1 EA = 1;
184 1 }
185 void IR_INT0(void) interrupt 0
186 {
187 1 if (__blearn)
188 1 {
189 2 __wirtime = 0;
190 2 if (__sbirin)
191 2 {
192 3 if (__wirlow)
193 3 {
194 4 IR[__dir] = __wirlow;
195 4 __wirlow = 0;
196 4 __dir ++;
197 4 }
198 3 if (__dir) __wirhigh ++;
199 3 if (__wirhigh == 0xFF)
200 3 {
201 4 IR[__dir] = 0xFF;//__wirhigh;
202 4 __wirhighcount ++;
203 4 if (__wirhighcount >= IR_HIGH_LENGTH)
204 4 {
205 5 EX0 = 0;//disable ir interrupt
206 5 __dir = __dir - (IR_HIGH_LENGTH-1);
207 5 __sbbusy = 1;
208 5 }
209 4 else
210 4 {
211 5 __wirhigh = 0x80;
212 5 __dir ++;
213 5 }
214 4 }
215 3 }
216 2 else
217 2 {
218 3 __wirhighcount = 0;
219 3 if (__wirhigh != 0x80)
220 3 {
221 4 IR[__dir] = __wirhigh;
222 4 __wirhigh = 0x80;
223 4 __dir ++;
224 4 }
225 3 __wirlow ++;
226 3 if (__wirlow == 0x7F)
227 3 {
228 4 IR[__dir] = __wirlow;
229 4 __wirlow = 0;
230 4 __dir ++;
231 4 }
232 3 }
233 2 }
234 1 else
235 1 {
236 2 if (__dirlong < __dir)
237 2 {
238 3 if (IR[__dirlong]&0x80) __sbirout0 = 1;
239 3 else __sbirout0 = 0;
240 3 IR[__dirlong] --;
241 3 if ((IR[__dirlong]&0x7F) == 0) __dirlong ++;
C51 COMPILER V7.06 IR 10/10/2003 10:51:50 PAGE 5
242 3 }
243 2 else
244 2 {
245 3 EX0 = 0;//disable ir interrupt
246 3 __sbirout0 = 1;
247 3 __dir = 0;
248 3 __dirlong = 0;
249 3 }
250 2 }
251 1 }
252 void TIMER0(void) interrupt 1
253 {
254 1 ;
255 1 }
256 void NIC_INT1(void) interrupt 2
257 {
258 1 //EA = 0;
259 1
260 1 ;//Deal_Packet();
261 1
262 1 //EA = 1;
263 1 }
264 void SERIAL(void) interrupt 4
265 {
266 1 if (RI == 1) RI = 0;
267 1 if (TI == 1) TI = 0;
268 1 }
269 void TIMER2(void) interrupt 5
270 {
271 1 TF2 = 0;//clear interrupt
272 1
273 1 TH2 = 0x3c;
274 1 TL2 = 0xaf;
275 1
276 1 __wsystemtimer ++;
277 1 if (__wsystemtimer >= TIME_1S)
278 1 {
279 2 __wsystemtimer = 0;
280 2 __wsend ++;
281 2 __wirtime ++;
282 2 }
283 1 }
284
285
286 /********************cpu end*********************************/
287
288 /*************************************************************************/
289 /***********ethernet begin*******************/
290 void Deal_Packet()
291 {
292 1 unsigned char xdata *point;
293 1 unsigned char i;
294 1 //unsigned char xdata __wcurr0,__wcurr1,__wcurr2;
295 1 //unsigned int PacketLength;
296 1 //unsigned int XmitPoint;
297 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -