📄 mainloop.ls1
字号:
01A6 0000 F 402 DW ?SC_65 ; ptr2
01A8 FF 403 DB 0FFH ; ptr3
01A9 0000 F 404 DW ?SC_74 ; ptr2
01AB FF 405 DB 0FFH ; ptr3
01AC 0000 F 406 DW ?SC_80 ; ptr2
01AE FF 407 DB 0FFH ; ptr3
01AF 0000 F 408 DW ?SC_87 ; ptr2
A51 MACRO ASSEMBLER MAINLOOP 03/23/2005 21:15:56 PAGE 8
409
01B1 410 _NAME_USB_STANDARD_REQUEST:
01B1 FF 411 DB 0FFH ; ptr3
01B2 0000 F 412 DW ?SC_96 ; ptr2
01B4 FF 413 DB 0FFH ; ptr3
01B5 0000 F 414 DW ?SC_107 ; ptr2
01B7 FF 415 DB 0FFH ; ptr3
01B8 0000 F 416 DW ?SC_121 ; ptr2
01BA FF 417 DB 0FFH ; ptr3
01BB 0000 F 418 DW ?SC_130 ; ptr2
01BD FF 419 DB 0FFH ; ptr3
01BE 0000 F 420 DW ?SC_121 ; ptr2
01C0 FF 421 DB 0FFH ; ptr3
01C1 0000 F 422 DW ?SC_142 ; ptr2
01C3 FF 423 DB 0FFH ; ptr3
01C4 0000 F 424 DW ?SC_154 ; ptr2
01C6 FF 425 DB 0FFH ; ptr3
01C7 0000 F 426 DW ?SC_169 ; ptr2
01C9 FF 427 DB 0FFH ; ptr3
01CA 0000 F 428 DW ?SC_184 ; ptr2
01CC FF 429 DB 0FFH ; ptr3
01CD 0000 F 430 DW ?SC_202 ; ptr2
01CF FF 431 DB 0FFH ; ptr3
01D0 0000 F 432 DW ?SC_220 ; ptr2
01D2 FF 433 DB 0FFH ; ptr3
01D3 0000 F 434 DW ?SC_234 ; ptr2
01D5 FF 435 DB 0FFH ; ptr3
01D6 0000 F 436 DW ?SC_248 ; ptr2
437
438
---- 439 RSEG ?C_INITSEG
0000 01 440 DB 001H
0001 00 F 441 DB last_key?1453
0002 0F 442 DB 00FH
443
444 ; /*
445 ; //*************************************************************************
446 ; //
447 ; // BASBA P R O P R I E T A R Y
448 ; //
449 ; // COPYRIGHT (c) 2003 BY BASBA USA.
450 ; // -- ALL RIGHTS RESERVED --
451 ; //
452 ; // File Name: MAINLOOP.H
453 ; // Purpose: Checks event flags and passes to appropriate subroutine
454 ; // for further processing. It also contain the code for
455 ; // human interface such as LED and key scan.
456 ; // Author: Shuming Yu
457 ; // Created: 10 May 2003
458 ; // Modified:
459 ; // Revision: 1.0
460 ; //
461 ; //*************************************************************************
462 ; */
463 ; #include <reg51.h> /* special function register declarations */
464 ;
465 ; #include "d12hal.h"
466 ; #include "cmds.h"
467 ; #include "mainloop.h"
468 ; #include "usbStruc.h"
469 ; #include "USBProto.h"
470 ;
471 ; /*
472 ; //*************************************************************************
473 ; // USB protocol function pointer arrays
474 ; //*************************************************************************
A51 MACRO ASSEMBLER MAINLOOP 03/23/2005 21:15:56 PAGE 9
475 ; */
476 ; code void (*StandardDeviceRequest[])(void) =
477 ; {
478 ; get_status,
479 ; clear_feature,
480 ; reserved,
481 ; set_feature,
482 ; reserved,
483 ; set_address,
484 ; get_descriptor,
485 ; reserved,
486 ; get_configuration,
487 ; set_configuration,
488 ; get_interface,
489 ; set_interface,
490 ; reserved,
491 ; reserved,
492 ; reserved,
493 ; reserved
494 ; };
495 ;
496 ; code void (*ClassRequest[])(void) =
497 ; {
498 ; reserved,
499 ; get_report,
500 ; get_idle,
501 ; get_protocol,
502 ; reserved,
503 ; reserved,
504 ; reserved,
505 ; reserved,
506 ; reserved,
507 ; set_report,
508 ; set_idle,
509 ; reserved,
510 ; reserved,
511 ; reserved,
512 ; reserved,
513 ; reserved
514 ; };
515 ;
516 ; code void (*VendorDeviceRequest[])(void) =
517 ; {
518 ; reserved,
519 ; reserved,
520 ; reserved,
521 ; reserved,
522 ; reserved,
523 ; reserved,
524 ; reserved,
525 ; reserved,
526 ; reserved,
527 ; reserved,
528 ; reserved,
529 ; reserved,
530 ; reserved,
531 ; reserved,
532 ; reserved,
533 ; reserved
534 ; };
535 ;
536 ; /*
537 ; //*************************************************************************
538 ; // Public static data
539 ; //*************************************************************************
540 ; */
A51 MACRO ASSEMBLER MAINLOOP 03/23/2005 21:15:56 PAGE 10
541 ;
542 ;
543 ; extern unsigned long ClockTicks;
544 ; extern unsigned char idata GenEpBuf[];
545 ;
546 ; EPPFLAGS bEPPflags; /* USB event flags */
547 ; CONTROL_XFER ControlData; /* Control endpoint TX/RX buffers */
548 ;
549 ; code char * _NAME_USB_REQUEST_DIRECTION[] =
550 ; {
551 ; "Host_to_device",
552 ; "Device_to_host"
553 ; };
554 ;
555 ; code char * _NAME_USB_REQUEST_RECIPIENT[] =
556 ; {
557 ; "Device",
558 ; "Interface",
559 ; "Endpoint(0)",
560 ; "Other"
561 ; };
562 ;
563 ; code char * _NAME_USB_REQUEST_TYPE[] =
564 ; {
565 ; "Standard",
566 ; "Class",
567 ; "Vendor",
568 ; "Reserved"
569 ; };
570 ;
571 ; code char * _NAME_USB_STANDARD_REQUEST[] =
572 ; {
573 ; "GET_STATUS",
574 ; "CLEAR_FEATURE",
575 ; "RESERVED",
576 ; "SET_FEATURE",
577 ; "RESERVED",
578 ; "SET_ADDRESS",
579 ; "GET_DESCRIPTOR",
580 ; "SET_DESCRIPTOR",
581 ; "GET_CONFIGURATION",
582 ; "SET_CONFIGURATION",
583 ; "GET_INTERFACE",
584 ; "SET_INTERFACE",
585 ; "SYNC_FRAME"
586 ; };
587 ;
588 ; void blinkLED(unsigned char num)
589
---- 590 RSEG ?PR?_blinkLED?MAINLOOP
0000 591 _blinkLED:
592 USING 0
593 ; SOURCE LINE # 145
0000 8F00 F 594 MOV num?040,R7
595 ; {
596 ; SOURCE LINE # 146
597 ; unsigned int i;
598 ; for (i=0; i<3; i++) {
599 ; SOURCE LINE # 148
0002 E4 600 CLR A
0003 F500 F 601 MOV i?041,A
0005 F500 F 602 MOV i?041+01H,A
0007 603 ?C0001:
604 ; if (num==0) {
605 ; SOURCE LINE # 149
0007 E500 F 606 MOV A,num?040
A51 MACRO ASSEMBLER MAINLOOP 03/23/2005 21:15:56 PAGE 11
0009 700C 607 JNZ ?C0004
608 ; MCU_LED0 = 0;
609 ; SOURCE LINE # 150
000B C292 610 CLR MCU_LED0
611 ; loop_delay(100);
612 ; SOURCE LINE # 151
000D 7F64 613 MOV R7,#064H
000F FE 614 MOV R6,A
0010 120000 F 615 LCALL _loop_delay
616 ; MCU_LED0 = 1;
617 ; SOURCE LINE # 152
0013 D292 618 SETB MCU_LED0
619 ; loop_delay(100);
620 ; SOURCE LINE # 153
621 ; }
622 ; SOURCE LINE # 154
0015 800B 623 SJMP ?C0056
0017 624 ?C0004:
625 ; else {
626 ; SOURCE LINE # 155
627 ; MCU_LED1 = 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -