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

📄 usb_int.txt

📁 STM32F103ZET6+UCOSII+UCGUI源码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
; generated by ARM C/C++ Compiler with , RVCT4.0 [Build 524] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\Obj\usb_int.o --depend=.\Obj\usb_int.d --device=DARMSTM --apcs=interwork -O3 -I..\..\include -I..\..\..\FWLib\library\inc -I..\..\..\USBLib\library\inc -I..\..\Config -I..\..\GUI\Core -I..\..\GUI\Font -I..\..\GUI\ConvertColor -I..\..\GUI\AntiAlias -I..\..\GUI\ConvertMono -I..\..\GUI\JPEG -I..\..\GUI\MemDev -I..\..\GUI\MultiLayer -I..\..\GUI\Widget -I..\..\GUI\WM -IC:\Keil\ARM\INC\ST\STM32F10x ..\..\..\USBLib\library\src\usb_int.c]
                          THUMB

                          AREA ||i.CTR_HP||, CODE, READONLY, ALIGN=2

                  CTR_HP PROC
;;;157    *******************************************************************************/
;;;158    void CTR_HP(void)
000000  b570              PUSH     {r4-r6,lr}
;;;159    {
;;;160      u32 wEPVal = 0;
;;;161    
;;;162      while (((wIstr = _GetISTR()) & ISTR_CTR) != 0)
;;;163      {
;;;164        _SetISTR((u16)CLR_CTR); /* clear CTR flag */
;;;165        /* extract highest priority endpoint number */
;;;166        EPindex = (u8)(wIstr & ISTR_EP_ID);
000002  4c1b              LDR      r4,|L1.112|
000004  4d1b              LDR      r5,|L1.116|
000006  4e1c              LDR      r6,|L1.120|
000008  e02b              B        |L1.98|
00000a  bf00              NOP                            ;164
                  |L1.12|
00000c  f64770ff          MOV      r0,#0x7fff            ;164
000010  f8c50c44          STR      r0,[r5,#0xc44]        ;164
000014  8830              LDRH     r0,[r6,#0]  ; wIstr
000016  f000000f          AND      r0,r0,#0xf
00001a  7020              STRB     r0,[r4,#0]
;;;167        /* process related endpoint register */
;;;168        wEPVal = _GetENDPOINT(EPindex);
00001c  b2c0              UXTB     r0,r0
00001e  eb050080          ADD      r0,r5,r0,LSL #2
000022  f8d01c00          LDR      r1,[r0,#0xc00]
000026  b289              UXTH     r1,r1
;;;169        if ((wEPVal & EP_CTR_RX) != 0)
000028  040a              LSLS     r2,r1,#16
00002a  d509              BPL      |L1.64|
;;;170        {
;;;171          /* clear int flag */
;;;172          _ClearEP_CTR_RX(EPindex);
00002c  f8d01c00          LDR      r1,[r0,#0xc00]
000030  f640728f          MOV      r2,#0xf8f
000034  b289              UXTH     r1,r1
000036  4011              ANDS     r1,r1,r2
000038  f8c01c00          STR      r1,[r0,#0xc00]
;;;173    
;;;174          /* call OUT service function */
;;;175          (*pEpInt_OUT[EPindex-1])();
00003c  480f              LDR      r0,|L1.124|
00003e  e00a              B        |L1.86|
                  |L1.64|
;;;176    
;;;177        } /* if((wEPVal & EP_CTR_RX) */
;;;178        else if ((wEPVal & EP_CTR_TX) != 0)
000040  0609              LSLS     r1,r1,#24
000042  d50e              BPL      |L1.98|
;;;179        {
;;;180          /* clear int flag */
;;;181          _ClearEP_CTR_TX(EPindex);
000044  f8d01c00          LDR      r1,[r0,#0xc00]
000048  f648720f          MOV      r2,#0x8f0f
00004c  b289              UXTH     r1,r1
00004e  4011              ANDS     r1,r1,r2
000050  f8c01c00          STR      r1,[r0,#0xc00]
;;;182    
;;;183          /* call IN service function */
;;;184          (*pEpInt_IN[EPindex-1])();
000054  480a              LDR      r0,|L1.128|
                  |L1.86|
000056  7821              LDRB     r1,[r4,#0]  ; EPindex
000058  eb000081          ADD      r0,r0,r1,LSL #2
00005c  f8500c04          LDR      r0,[r0,#-4]
000060  4780              BLX      r0
                  |L1.98|
000062  f8d50c44          LDR      r0,[r5,#0xc44]        ;162
000066  8030              STRH     r0,[r6,#0]            ;162
000068  0400              LSLS     r0,r0,#16             ;162
00006a  d4cf              BMI      |L1.12|
;;;185    
;;;186    
;;;187        } /* if((wEPVal & EP_CTR_TX) != 0) */
;;;188    
;;;189      }/* while(...) */
;;;190    }
00006c  bd70              POP      {r4-r6,pc}
;;;191    
                          ENDP

00006e  0000              DCW      0x0000
                  |L1.112|
                          DCD      EPindex
                  |L1.116|
                          DCD      0x40005000
                  |L1.120|
                          DCD      wIstr
                  |L1.124|
                          DCD      pEpInt_OUT
                  |L1.128|
                          DCD      pEpInt_IN

                          AREA ||i.CTR_LP||, CODE, READONLY, ALIGN=2

                  CTR_LP PROC
;;;40     *******************************************************************************/
;;;41     void CTR_LP(void)
000000  e92d5ff0          PUSH     {r4-r12,lr}
;;;42     {
;;;43       u32 wEPVal = 0;
;;;44       /* stay in loop while pending ints */
;;;45       while (((wIstr = _GetISTR()) & ISTR_CTR) != 0)
;;;46       {
;;;47         _SetISTR((u16)CLR_CTR); /* clear CTR flag */
;;;48         /* extract highest priority endpoint number */
;;;49         EPindex = (u8)(wIstr & ISTR_EP_ID);
;;;50         if (EPindex == 0)
;;;51         {
;;;52           /* Decode and service control endpoint interrupt */
;;;53           /* calling related service routine */
;;;54           /* (Setup0_Process, In0_Process, Out0_Process) */
;;;55     
;;;56           /* save RX & TX status */
;;;57           /* and set both to NAK */
;;;58           SaveRState = _GetEPRxStatus(ENDP0);
;;;59           SaveTState = _GetEPTxStatus(ENDP0);
;;;60           _SetEPRxStatus(ENDP0, EP_RX_NAK);
000004  f64b788f          MOV      r8,#0xbf8f
;;;61           _SetEPTxStatus(ENDP0, EP_TX_NAK);
000008  f64879bf          MOV      r9,#0x8fbf
00000c  4f56              LDR      r7,|L2.360|
;;;62     
;;;63     
;;;64           /* DIR bit = origin of the interrupt */
;;;65     
;;;66           if ((wIstr & ISTR_DIR) == 0)
;;;67           {
;;;68             /* DIR = 0 */
;;;69     
;;;70             /* DIR = 0      => IN  int */
;;;71             /* DIR = 0 implies that (EP_CTR_TX = 1) always  */
;;;72     
;;;73     
;;;74             _ClearEP_CTR_TX(ENDP0);
;;;75             In0_Process();
;;;76     
;;;77                /* before terminate set Tx & Rx status */
;;;78               _SetEPRxStatus(ENDP0, SaveRState);
;;;79               _SetEPTxStatus(ENDP0, SaveTState);
;;;80               return;
;;;81           }
;;;82           else
;;;83           {
;;;84             /* DIR = 1 */
;;;85     
;;;86             /* DIR = 1 & CTR_RX       => SETUP or OUT int */
;;;87             /* DIR = 1 & (CTR_TX | CTR_RX) => 2 int pending */
;;;88     
;;;89             wEPVal = _GetENDPOINT(ENDP0);
;;;90             if ((wEPVal & EP_CTR_TX) != 0)
;;;91             {
;;;92               _ClearEP_CTR_TX(ENDP0);
;;;93               In0_Process();
;;;94               /* before terminate set Tx & Rx status */
;;;95               _SetEPRxStatus(ENDP0, SaveRState);
;;;96               _SetEPTxStatus(ENDP0, SaveTState);
;;;97               return;
;;;98             }
;;;99             else if ((wEPVal &EP_SETUP) != 0)
;;;100            {
;;;101              _ClearEP_CTR_RX(ENDP0); /* SETUP bit kept frozen while CTR_RX = 1 */
00000e  f6407a8f          MOV      r10,#0xf8f
000012  4e56              LDR      r6,|L2.364|
000014  f6487b0f          MOV      r11,#0x8f0f           ;74
000018  4c55              LDR      r4,|L2.368|
00001a  e09c              B        |L2.342|
                  |L2.28|
00001c  f64770ff          MOV      r0,#0x7fff            ;47
000020  f8c40c44          STR      r0,[r4,#0xc44]        ;47
000024  8808              LDRH     r0,[r1,#0]            ;49  ; wIstr
000026  f000000f          AND      r0,r0,#0xf            ;49
00002a  7030              STRB     r0,[r6,#0]            ;49
00002c  b2c0              UXTB     r0,r0                 ;50
00002e  2800              CMP      r0,#0                 ;50
000030  d169              BNE      |L2.262|
000032  f5046440          ADD      r4,r4,#0xc00          ;50
000036  6820              LDR      r0,[r4,#0]            ;58
000038  f3c03001          UBFX     r0,r0,#12,#2          ;58

⌨️ 快捷键说明

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