📄 timer.ls1
字号:
208 USING 0
209 ; SOURCE LINE # 66
0000 1500 F 210 DEC ?C_IBP
0002 1500 F 211 DEC ?C_IBP
0004 1500 F 212 DEC ?C_IBP
213 ; {
214 ; unsigned char ie = IE;
215 ; SOURCE LINE # 68
0006 A800 F 216 MOV R0,?C_IBP
0008 A6A8 217 MOV @R0,IE
218 ; jiffies_t ret;
219 ; EA = 0;
220 ; SOURCE LINE # 70
000A C2AF 221 CLR EA
222 ; ret = jiffies;
223 ; SOURCE LINE # 71
000C A800 F 224 MOV R0,?C_IBP
000E 08 225 INC R0
000F A600 F 226 MOV @R0,jiffies
0011 08 227 INC R0
0012 A600 F 228 MOV @R0,jiffies+01H
229 ; IE = ie;
230 ; SOURCE LINE # 72
0014 A800 F 231 MOV R0,?C_IBP
0016 E6 232 MOV A,@R0
0017 F5A8 233 MOV IE,A
234 ; return ret;
235 ; SOURCE LINE # 73
0019 A800 F 236 MOV R0,?C_IBP
001B 08 237 INC R0
001C E6 238 MOV A,@R0
001D FE 239 MOV R6,A
001E 08 240 INC R0
001F E6 241 MOV A,@R0
0020 FF 242 MOV R7,A
243 ; }
244 ; SOURCE LINE # 74
0021 245 ?C0001:
0021 0500 F 246 INC ?C_IBP
0023 0500 F 247 INC ?C_IBP
0025 0500 F 248 INC ?C_IBP
0027 22 249 RET
250 ; END OF _?get_jiffies
251
252 ;
253 ; #if 0
254 ;
255 ; void get_timeofday(struct time_val data *tv)
256 ; {
A51 MACRO ASSEMBLER TIMER 12/27/2003 22:39:17 PAGE 5
257 ; EA = 0;
258 ; tv->sec = xtime.sec;
259 ; tv->msec = xtime.msec;
260 ; EA = 1;
261 ; }
262 ;
263 ; void mdelay(unsigned char ms)
264 ; {
265 ; jiffies_t jiff;
266 ; while (ms >= 10) {
267 ; jiff = get_jiffies()+HZ/100;
268 ; while (time_before_eq(get_jiffies(), jiff));
269 ; ms -= 10;
270 ; wdt_reset();
271 ; }
272 ; }
273 ; #endif
274 ;
275 ; #if 0
276 ; static struct timer_list data *timer_head = NULL;
277 ;
278 ; static void run_timer_list(void)
279 ; {
280 ; while (timer_head && time_after_eq(get_jiffies(), timer_head->expires)) {
281 ; struct timer_list data *p = timer_head;
282 ; timer_head = p->next;
283 ; p->next = NULL;
284 ; p->function();
285 ; }
286 ; }
287 ;
288 ; void init_timer(struct timer_list data *timer) reentrant
289 ; {
290 ; timer->next = NULL;
291 ; }
292 ;
293 ; bit add_timer(struct timer_list data *timer) reentrant
294 ; {
295 ; struct timer_list data * data *pp, data *p;
296 ; unsigned char ie = IE;
297 ; EA = 0;
298 ; if (timer->next) {
299 ; IE = ie;
300 ; return 0;
301 ; }
302 ; for (pp = &timer_head; (p = *pp) != NULL; pp = &p->next) {
303 ; if (time_after(p->expires, timer->expires))
304 ; break;
305 ; }
306 ; timer->next = p;
307 ; *pp = timer;
308 ; IE = ie;
309 ; return 1;
310 ; }
311 ;
312 ; #if 0
313 ; bit del_timer(struct timer_list data *timer) reentrant
314 ; {
315 ; struct timer_list data * data *pp, data *p;
316 ; unsigned char ie = IE;
317 ; EA = 0;
318 ; if (!timer->next)
319 ; goto err_out;
320 ; for (pp = &timer_head; (p = *pp) != NULL; pp = &p->next) {
321 ; if (p == timer) {
322 ; *pp = p->next;
A51 MACRO ASSEMBLER TIMER 12/27/2003 22:39:17 PAGE 6
323 ; p->next = NULL;
324 ; IE = ie;
325 ; return 1;
326 ; }
327 ; }
328 ; err_out:
329 ; IE = ie;
330 ; return 0;
331 ; }
332 ; #endif
333 ;
334 ;
335 ; #endif
336 ;
337 ; bit use_timer1 = 0;
338 ; bit pal_auto = 0;
339 ; #define MAX_T0 50
340 ; static unsigned short t0_count = MAX_T0;
341 ;
342 ; void timer_bh(void)
343
---- 344 RSEG ?PR?timer_bh?TIMER
0000 345 timer_bh:
346 USING 0
347 ; SOURCE LINE # 165
348 ; {
349 ; SOURCE LINE # 166
350 ; void check_key(void) reentrant;
351 ; #if 1
352 ; EA = 0;
353 ; SOURCE LINE # 169
0000 C2AF 354 CLR EA
0002 355 ?C0002:
356 ; while (xjiffies != jiffies) {
357 ; SOURCE LINE # 170
0002 E500 F 358 MOV A,xjiffies+01H
0004 6500 F 359 XRL A,jiffies+01H
0006 7004 360 JNZ ?C0011
0008 E500 F 361 MOV A,xjiffies
000A 6500 F 362 XRL A,jiffies
000C 363 ?C0011:
000C 6012 364 JZ ?C0003
365 ; // xtime.msec += 1000/HZ;
366 ; xjiffies++;
367 ; SOURCE LINE # 172
000E 0500 F 368 INC xjiffies+01H
0010 E500 F 369 MOV A,xjiffies+01H
0012 7002 370 JNZ ?C0012
0014 0500 F 371 INC xjiffies
0016 372 ?C0012:
373 ; t0_count--;
374 ; SOURCE LINE # 173
0016 E500 F 375 MOV A,t0_count+01H
0018 1500 F 376 DEC t0_count+01H
001A 70E6 377 JNZ ?C0002
001C 1500 F 378 DEC t0_count
001E 379 ?C0013:
380 ; }
381 ; SOURCE LINE # 174
001E 80E2 382 SJMP ?C0002
0020 383 ?C0003:
384 ; EA = 1;
385 ; SOURCE LINE # 175
0020 D2AF 386 SETB EA
387 ; #endif
388 ; #if 0
A51 MACRO ASSEMBLER TIMER 12/27/2003 22:39:17 PAGE 7
389 ; while (xtime.msec >= 1000) {
390 ; xtime.sec++;
391 ; xtime.msec -= 1000;
392 ; }
393 ; #endif
394 ; check_key();
395 ; SOURCE LINE # 183
0022 120000 F 396 LCALL _?check_key
397 ; #if 1
398 ; if (use_timer1 || t0_count == 0) {
399 ; SOURCE LINE # 185
0025 200006 F 400 JB use_timer1,?C0005
0028 E500 F 401 MOV A,t0_count+01H
002A 4500 F 402 ORL A,t0_count
002C 7034 403 JNZ ?C0009
002E 404 ?C0005:
405 ; TR1 = 0;
406 ; SOURCE LINE # 186
002E C28E 407 CLR TR1
408 ; if (use_timer1 == 0 && pal_auto) {
409 ; SOURCE LINE # 187
0030 20001C F 410 JB use_timer1,?C0006
0033 300019 F 411 JNB pal_auto,?C0006
412 ; unsigned short t1_count;
413 ; t1_count = (TH1<<8)|TL1;
414 ; SOURCE LINE # 189
0036 AF8D 415 MOV R7,TH1
0038 EF 416 MOV A,R7
0039 AD8B 417 MOV R5,TL1
003B F500 F 418 MOV t1_count?140,A
003D ED 419 MOV A,R5
003E F500 F 420 MOV t1_count?140+01H,A
421 ; if (t1_count > MAX_T0*11/20)//55/HZ)
422 ; SOURCE LINE # 190
0040 D3 423 SETB C
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -