⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainloop.ls1

📁 Comlete files for fullfile the slave USB function!
💻 LS1
📖 第 1 页 / 共 5 页
字号:
01B5 0000     F      402             DW      ?SC_107  ; ptr2
01B7 FF              403             DB      0FFH     ; ptr3
01B8 0000     F      404             DW      ?SC_121  ; ptr2
01BA FF              405             DB      0FFH     ; ptr3
01BB 0000     F      406             DW      ?SC_130  ; ptr2
01BD FF              407             DB      0FFH     ; ptr3
01BE 0000     F      408             DW      ?SC_121  ; ptr2
A51 MACRO ASSEMBLER  MAINLOOP                                                             04/22/2005 11:54:48 PAGE     8

01C0 FF              409             DB      0FFH     ; ptr3
01C1 0000     F      410             DW      ?SC_142  ; ptr2
01C3 FF              411             DB      0FFH     ; ptr3
01C4 0000     F      412             DW      ?SC_154  ; ptr2
01C6 FF              413             DB      0FFH     ; ptr3
01C7 0000     F      414             DW      ?SC_169  ; ptr2
01C9 FF              415             DB      0FFH     ; ptr3
01CA 0000     F      416             DW      ?SC_184  ; ptr2
01CC FF              417             DB      0FFH     ; ptr3
01CD 0000     F      418             DW      ?SC_202  ; ptr2
01CF FF              419             DB      0FFH     ; ptr3
01D0 0000     F      420             DW      ?SC_220  ; ptr2
01D2 FF              421             DB      0FFH     ; ptr3
01D3 0000     F      422             DW      ?SC_234  ; ptr2
01D5 FF              423             DB      0FFH     ; ptr3
01D6 0000     F      424             DW      ?SC_248  ; ptr2
                     425     
                     426     
----                 427             RSEG  ?C_INITSEG
0000 01              428             DB      001H
0001 00       F      429             DB      last_key?1449
0002 0F              430             DB      00FH
                     431     
                     432     ; /*
                     433     ; //*************************************************************************
                     434     ; //
                     435     ; //                  BASBA   P R O P R I E T A R Y
                     436     ; //
                     437     ; //           COPYRIGHT (c)   2003 BY BASBA USA.
                     438     ; //                     --  ALL RIGHTS RESERVED  --
                     439     ; //
                     440     ; // File Name: MAINLOOP.H
                     441     ; // Purpose:           Checks event flags and passes to appropriate subroutine
                     442     ; //                            for further processing.  It also contain the code for
                     443     ; //                            human interface such as LED and key scan.
                     444     ; // Author:            Shuming Yu
                     445     ; // Created:           10 May 2003
                     446     ; // Modified:
                     447     ; // Revision:          1.0
                     448     ; //
                     449     ; //*************************************************************************
                     450     ; */
                     451     ; #include <reg51.h>                /* special function register declarations   */
                     452     ; 
                     453     ; #include "d12hal.h"
                     454     ; #include "cmds.h"
                     455     ; #include "mainloop.h"
                     456     ; #include "usbStruc.h"
                     457     ; #include "USBProto.h"
                     458     ; 
                     459     ; /*
                     460     ; //*************************************************************************
                     461     ; // USB protocol function pointer arrays
                     462     ; //*************************************************************************
                     463     ; */
                     464     ; code void (*StandardDeviceRequest[])(void) =
                     465     ; {
                     466     ;       get_status,
                     467     ;       clear_feature,
                     468     ;       reserved,
                     469     ;       set_feature,
                     470     ;       reserved,
                     471     ;       set_address,
                     472     ;       get_descriptor,
                     473     ;       reserved,
                     474     ;       get_configuration,
A51 MACRO ASSEMBLER  MAINLOOP                                                             04/22/2005 11:54:48 PAGE     9

                     475     ;       set_configuration,
                     476     ;       get_interface,
                     477     ;       set_interface,
                     478     ;       reserved,
                     479     ;       reserved,
                     480     ;       reserved,
                     481     ;       reserved
                     482     ; };
                     483     ; 
                     484     ; code void (*ClassRequest[])(void) =
                     485     ; {
                     486     ;       reserved,
                     487     ;       get_report,
                     488     ;       get_idle,
                     489     ;       get_protocol,
                     490     ;       reserved,
                     491     ;       reserved,
                     492     ;       reserved,
                     493     ;       reserved,
                     494     ;       reserved,
                     495     ;       set_report,
                     496     ;       set_idle,
                     497     ;       reserved,
                     498     ;       reserved,
                     499     ;       reserved,
                     500     ;       reserved,
                     501     ;       reserved
                     502     ; };
                     503     ; 
                     504     ; code void (*VendorDeviceRequest[])(void) =
                     505     ; {
                     506     ;       reserved,
                     507     ;       reserved,
                     508     ;       reserved,
                     509     ;       reserved,
                     510     ;       reserved,
                     511     ;       reserved,
                     512     ;       reserved,
                     513     ;       reserved,
                     514     ;       reserved,
                     515     ;       reserved,
                     516     ;       reserved,
                     517     ;       reserved,
                     518     ;       reserved,
                     519     ;       reserved,
                     520     ;       reserved,
                     521     ;       reserved
                     522     ; };
                     523     ; 
                     524     ; /*
                     525     ; //*************************************************************************
                     526     ; //  Public static data
                     527     ; //*************************************************************************
                     528     ; */
                     529     ; 
                     530     ; 
                     531     ; extern unsigned long ClockTicks;
                     532     ; extern unsigned char idata GenEpBuf[];
                     533     ; 
                     534     ; EPPFLAGS bEPPflags; /* USB event flags */
                     535     ; CONTROL_XFER ControlData; /* Control endpoint TX/RX buffers */
                     536     ; 
                     537     ; code char * _NAME_USB_REQUEST_DIRECTION[] =
                     538     ; {
                     539     ; "Host_to_device",
                     540     ; "Device_to_host"
A51 MACRO ASSEMBLER  MAINLOOP                                                             04/22/2005 11:54:48 PAGE    10

                     541     ; };
                     542     ; 
                     543     ; code char * _NAME_USB_REQUEST_RECIPIENT[] =
                     544     ; {
                     545     ; "Device",
                     546     ; "Interface",
                     547     ; "Endpoint(0)",
                     548     ; "Other"
                     549     ; };
                     550     ; 
                     551     ; code char * _NAME_USB_REQUEST_TYPE[] =
                     552     ; {
                     553     ; "Standard",
                     554     ; "Class",
                     555     ; "Vendor",
                     556     ; "Reserved"
                     557     ; };
                     558     ; 
                     559     ; code char * _NAME_USB_STANDARD_REQUEST[] =
                     560     ; {
                     561     ; "GET_STATUS",
                     562     ; "CLEAR_FEATURE",
                     563     ; "RESERVED",
                     564     ; "SET_FEATURE",
                     565     ; "RESERVED",
                     566     ; "SET_ADDRESS",
                     567     ; "GET_DESCRIPTOR",
                     568     ; "SET_DESCRIPTOR",
                     569     ; "GET_CONFIGURATION",
                     570     ; "SET_CONFIGURATION",
                     571     ; "GET_INTERFACE",
                     572     ; "SET_INTERFACE",
                     573     ; "SYNC_FRAME"
                     574     ; };
                     575     ; 
                     576     ; void blinkLED(unsigned char num)
                     577     
----                 578             RSEG  ?PR?_blinkLED?MAINLOOP
0000                 579     _blinkLED:
                     580             USING   0
                     581                             ; SOURCE LINE # 145
0000 8F00     F      582             MOV     num?040,R7
                     583     ; {
                     584                             ; SOURCE LINE # 146
                     585     ;       unsigned int i;
                     586     ;       for (i=0; i<3; i++) {
                     587                             ; SOURCE LINE # 148
0002 E4              588             CLR     A
0003 F500     F      589             MOV     i?041,A
0005 F500     F      590             MOV     i?041+01H,A
0007                 591     ?C0001:
                     592     ;               if (num==0) {
                     593                             ; SOURCE LINE # 149
0007 E500     F      594             MOV     A,num?040
0009 700C            595             JNZ     ?C0004
                     596     ;                       MCU_LED0 = 0;
                     597                             ; SOURCE LINE # 150
000B C292            598             CLR     MCU_LED0
                     599     ;                       loop_delay(100);
                     600                             ; SOURCE LINE # 151
000D 7F64            601             MOV     R7,#064H
000F FE              602             MOV     R6,A
0010 120000   F      603             LCALL   _loop_delay
                     604     ;                       MCU_LED0 = 1;
                     605                             ; SOURCE LINE # 152
0013 D292            606             SETB    MCU_LED0
A51 MACRO ASSEMBLER  MAINLOOP                                                             04/22/2005 11:54:48 PAGE    11

                     607     ;                       loop_delay(100);
                     608                             ; SOURCE LINE # 153
                     609     ;                }
                     610                             ; SOURCE LINE # 154
0015 800B            611             SJMP    ?C0056
0017                 612     ?C0004:
                     613     ;                else {
                     614                             ; SOURCE LINE # 155
                     615     ;                       MCU_LED1 = 0;
                     616                             ; SOURCE LINE # 156
0017 C293            617             CLR     MCU_LED1
                     618     ;                       loop_delay(100);
                     619                             ; SOURCE LINE # 157
0019 7F64            620             MOV     R7,#064H
001B 7E00            621             MOV     R6,#00H
001D 120000   F      622             LCALL   _loop_delay
                     623     ;                       MCU_LED1 = 1;
                     624                             ; SOURCE LINE # 158
0020 D293            625             SETB    MCU_LED1
                     626     ;                       loop_delay(100);
                     627                             ; SOURCE LINE # 159

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -