; generated by ARM C/C++ Compiler, 4.1 [Build 713]
; commandline ArmCC [--list --split_sections --debug -c --asm --interleave -o.\Obj\usb_int.o --asm_dir=.\List\ --list_dir=.\List\ --depend=.\Obj\usb_int.d --cpu=Cortex-M3 --apcs=interwork -O3 -I.\usb_library\inc -IC:\Keil\ARM\CMSIS\Include -IC:\Keil\ARM\INC\ST\STM32F10x -D__MICROLIB -DVECT_TAB_FLASH --omf_browse=.\Obj\usb_int.crf usb_library\src\usb_int.c]
                          THUMB

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

                  CTR_HP PROC
;;;155    *******************************************************************************/
;;;156    void CTR_HP(void)
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;157    {
;;;158      u32 wEPVal;
;;;159    
;;;160      while (((wIstr = _GetISTR()) & ISTR_CTR) != 0)
;;;161      {
;;;162        _SetISTR((u16)CLR_CTR); /* clear CTR flag */
000004  f8df8078          LDR      r8,|L1.128|
;;;163        /* extract highest priority endpoint number */
;;;164        EPindex = (u8)(wIstr & ISTR_EP_ID);
000008  4c1c              LDR      r4,|L1.124|
;;;165        /* process related endpoint register */
;;;166        wEPVal = _GetENDPOINT(EPindex);
00000a  4d1d              LDR      r5,|L1.128|
00000c  f1080844          ADD      r8,r8,#0x44           ;162
000010  4e1c              LDR      r6,|L1.132|
;;;167        if ((wEPVal & EP_CTR_RX) != 0)
;;;168        {
;;;169          /* clear int flag */
;;;170          _ClearEP_CTR_RX(EPindex);
;;;171    
;;;172          /* call OUT service function */
;;;173          (*pEpInt_OUT[EPindex-1])();
;;;174    
;;;175        } /* if((wEPVal & EP_CTR_RX) */
;;;176        if ((wEPVal & EP_CTR_TX) != 0)
;;;177        {
;;;178          /* clear int flag */
;;;179          _ClearEP_CTR_TX(EPindex);
;;;180    
;;;181          /* call IN service function */
;;;182          (*pEpInt_IN[EPindex-1])();
000012  e02b              B        |L1.108|
                  |L1.20|
000014  f64771ff          MOV      r1,#0x7fff            ;162
000018  6001              STR      r1,[r0,#0]            ;162
00001a  8830              LDRH     r0,[r6,#0]            ;164  ; wIstr
00001c  f000000f          AND      r0,r0,#0xf            ;164
000020  7020              STRB     r0,[r4,#0]            ;164
000022  eb050080          ADD      r0,r5,r0,LSL #2       ;166
000026  6801              LDR      r1,[r0,#0]            ;166
000028  b28f              UXTH     r7,r1                 ;166
00002a  0439              LSLS     r1,r7,#16             ;167
00002c  d50c              BPL      |L1.72|
00002e  6801              LDR      r1,[r0,#0]            ;170
000030  f640728f          MOV      r2,#0xf8f             ;170
000034  b289              UXTH     r1,r1                 ;170
000036  4011              ANDS     r1,r1,r2              ;170
000038  6001              STR      r1,[r0,#0]            ;170
00003a  4813              LDR      r0,|L1.136|
00003c  7821              LDRB     r1,[r4,#0]            ;173  ; EPindex
00003e  eb000081          ADD      r0,r0,r1,LSL #2       ;173
000042  f8500c04          LDR      r0,[r0,#-4]           ;173
000046  4780              BLX      r0                    ;173
                  |L1.72|
000048  0638              LSLS     r0,r7,#24             ;176
00004a  d50f              BPL      |L1.108|
00004c  7820              LDRB     r0,[r4,#0]            ;179  ; EPindex
00004e  eb050080          ADD      r0,r5,r0,LSL #2       ;179
000052  6801              LDR      r1,[r0,#0]            ;179
000054  f648720f          MOV      r2,#0x8f0f            ;179
000058  b289              UXTH     r1,r1                 ;179
00005a  4011              ANDS     r1,r1,r2              ;179
00005c  6001              STR      r1,[r0,#0]            ;179
00005e  480b              LDR      r0,|L1.140|
000060  7821              LDRB     r1,[r4,#0]  ; EPindex
000062  eb000081          ADD      r0,r0,r1,LSL #2
000066  f8500c04          LDR      r0,[r0,#-4]
00006a  4780              BLX      r0
                  |L1.108|
00006c  f8d81000          LDR      r1,[r8,#0]            ;160
000070  4640              MOV      r0,r8                 ;160
000072  8031              STRH     r1,[r6,#0]            ;160
000074  0409              LSLS     r1,r1,#16             ;160
000076  d4cd              BMI      |L1.20|
;;;183    
;;;184    
;;;185        } /* if((wEPVal & EP_CTR_TX) != 0) */
;;;186    
;;;187      }/* while(...) */
;;;188    }
000078  e8bd81f0          POP      {r4-r8,pc}
;;;189    
                          ENDP

                  |L1.124|
                          DCD      EPindex
                  |L1.128|
                          DCD      0x40005c00
                  |L1.132|
                          DCD      wIstr
                  |L1.136|
                          DCD      pEpInt_OUT
                  |L1.140|
                          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;
;;;44       /* stay in loop while pending ints */
;;;45       while (((wIstr = _GetISTR()) & ISTR_CTR) != 0)
;;;46       {
;;;47         _SetISTR((u16)CLR_CTR); /* clear CTR flag */
000004  4e58              LDR      r6,|L2.360|
;;;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);
000006  f8dfa158          LDR      r10,|L2.352|
;;;59           SaveTState = _GetEPTxStatus(ENDP0);
;;;60           _SetEPRxStatus(ENDP0, EP_RX_NAK);
;;;61           _SetEPTxStatus(ENDP0, EP_TX_NAK);
;;;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             /* check if SETUP arrived during IN processing */
;;;78             wEPVal = _GetENDPOINT(ENDP0);
;;;79             if ((wEPVal & (EP_CTR_RX | EP_SETUP)) != 0)
;;;80             {
;;;81               _ClearEP_CTR_RX(ENDP0); /* SETUP bit kept frozen while CTR_RX = 1 */
00000a  f6407b8f          MOV      r11,#0xf8f
00000e  f8df9154          LDR      r9,|L2.356|
000012  4c55              LDR      r4,|L2.360|
000014  f648780f          MOV      r8,#0x8f0f            ;74
000018  3644              ADDS     r6,r6,#0x44           ;47
00001a  4d54              LDR      r5,|L2.364|
00001c  e02f              B        |L2.126|
00001e  bf00              NOP                            ;47
                  |L2.32|
000020  f64770ff          MOV      r0,#0x7fff            ;47
000024  6030              STR      r0,[r6,#0]            ;47
000026  8828              LDRH     r0,[r5,#0]            ;49  ; wIstr
000028  f010000f          ANDS     r0,r0,#0xf            ;49
00002c  f8890000          STRB     r0,[r9,#0]            ;49
000030  d02b              BEQ      |L2.138|
;;;82               Setup0_Process();
;;;83             }
;;;84     
;;;85           }
;;;86     
;;;87           else
;;;88           {
;;;89             /* DIR = 1 */
;;;90     
;;;91             /* DIR = 1 & CTR_RX       => SETUP or OUT int */
;;;92             /* DIR = 1 & (CTR_TX | CTR_RX) => 2 int pending */
;;;93     
;;;94             wEPVal = _GetENDPOINT(ENDP0);
;;;95             if ((wEPVal & EP_CTR_TX) != 0)
;;;96             {
;;;97               _ClearEP_CTR_TX(ENDP0);
;;;98               In0_Process();
;;;99             }
;;;100            if ((wEPVal &EP_SETUP) != 0)
;;;101            {
;;;102              _ClearEP_CTR_RX(ENDP0); /* SETUP bit kept frozen while CTR_RX = 1 */
;;;103              Setup0_Process();
;;;104            }
;;;105    
;;;106            else if ((wEPVal & EP_CTR_RX) != 0)
;;;107            {
;;;108              _ClearEP_CTR_RX(ENDP0);
;;;109              Out0_Process();
;;;110            }
;;;111    
;;;112          }
;;;113    
;;;114          /* before terminate set Tx & Rx status */
;;;115          _SetEPRxStatus(ENDP0, SaveRState);
;;;116          _SetEPTxStatus(ENDP0, SaveTState);
;;;117        }/* if(EPindex == 0) */
;;;118        else
;;;119        {
;;;120          /* Decode and service non control endpoints interrupt  */
;;;121    
;;;122          /* process related endpoint register */
;;;123          wEPVal = _GetENDPOINT(EPindex);
000032  eb040080          ADD      r0,r4,r0,LSL #2
000036  6801              LDR      r1,[r0,#0]
000038  b28f              UXTH     r7,r1
;;;124          if ((wEPVal & EP_CTR_RX) != 0)
00003a  0439              LSLS     r1,r7,#16
00003c  d50c              BPL      |L2.88|
;;;125          {
;;;126            /* clear int flag */
;;;127            _ClearEP_CTR_RX(EPindex);
00003e  6801              LDR      r1,[r0,#0]
000040  b289              UXTH     r1,r1
000042  ea01010b          AND      r1,r1,r11
000046  6001              STR      r1,[r0,#0]
;;;128    
;;;129            /* call OUT service function */
;;;130            (*pEpInt_OUT[EPindex-1])();
000048  4849              LDR      r0,|L2.368|
00004a  f8991000          LDRB     r1,[r9,#0]  ; EPindex
00004e  eb000081          ADD      r0,r0,r1,LSL #2
000052  f8500c04          LDR      r0,[r0,#-4]
000056  4780              BLX      r0
                  |L2.88|
;;;131    
;;;132          } /* if((wEPVal & EP_CTR_RX) */
;;;133    
;;;134          if ((wEPVal & EP_CTR_TX) != 0)
000058  0638              LSLS     r0,r7,#24
00005a  d510              BPL      |L2.126|
;;;135          {
;;;136            /* clear int flag */
;;;137            _ClearEP_CTR_TX(EPindex);
00005c  f8991000          LDRB     r1,[r9,#0]  ; EPindex
000060  eb040281          ADD      r2,r4,r1,LSL #2
000064  6811              LDR      r1,[r2,#0]
000066  b28b              UXTH     r3,r1
000068  ea030308          AND      r3,r3,r8
00006c  6013              STR      r3,[r2,#0]
;;;138    
;;;139            /* call IN service function */
;;;140            (*pEpInt_IN[EPindex-1])();
00006e  4941              LDR      r1,|L2.372|
000070  f8990000          LDRB     r0,[r9,#0]  ; EPindex
000074  eb010080          ADD      r0,r1,r0,LSL #2
000078  f8500c04          LDR      r0,[r0,#-4]
00007c  4780              BLX      r0
                  |L2.126|
00007e  6830              LDR      r0,[r6,#0]            ;45
000080  8028              STRH     r0,[r5,#0]            ;45
000082  0400              LSLS     r0,r0,#16             ;45
000084  d4cc              BMI      |L2.32|
;;;141          } /* if((wEPVal & EP_CTR_TX) != 0) */
;;;142    
;;;143        }/* if(EPindex == 0) else */
;;;144    
;;;145      }/* while(...) */
;;;146    }
000086  e8bd9ff0          POP      {r4-r12,pc}
                  |L2.138|
00008a  6820              LDR      r0,[r4,#0]            ;58
00008c  f3c03001          UBFX     r0,r0,#12,#2          ;58
000090  0301              LSLS     r1,r0,#12             ;58
000092  f8aa1000          STRH     r1,[r10,#0]           ;58
000096  6821              LDR      r1,[r4,#0]            ;59
000098  f3c11101          UBFX     r1,r1,#4,#2           ;59
00009c  ea4f1101          LSL      r1,r1,#4              ;59
0000a0  f8aa1002          STRH     r1,[r10,#2]           ;59
0000a4  6820              LDR      r0,[r4,#0]            ;60
0000a6  f64b718f          MOV      r1,#0xbf8f            ;60
0000aa  b280              UXTH     r0,r0                 ;60
0000ac  4008              ANDS     r0,r0,r1              ;60
0000ae  f4805000          EOR      r0,r0,#0x2000         ;60
0000b2  6020              STR      r0,[r4,#0]            ;60
0000b4  6820              LDR      r0,[r4,#0]            ;61
0000b6  f64871bf          MOV      r1,#0x8fbf            ;61
0000ba  b280              UXTH     r0,r0                 ;61
0000bc  4008              ANDS     r0,r0,r1              ;61
0000be  f0800020          EOR      r0,r0,#0x20           ;61
0000c2  6020              STR      r0,[r4,#0]            ;61
0000c4  8828              LDRH     r0,[r5,#0]            ;66  ; wIstr
0000c6  06c0              LSLS     r0,r0,#27             ;66
0000c8  6820              LDR      r0,[r4,#0]            ;94
0000ca  d40a              BMI      |L2.226|
0000cc  b280              UXTH     r0,r0                 ;74
0000ce  ea000008          AND      r0,r0,r8              ;74
0000d2  6020              STR      r0,[r4,#0]            ;74
0000d4  f7fffffe          BL       In0_Process
0000d8  6820              LDR      r0,[r4,#0]            ;78
0000da  f4104f08          TST      r0,#0x8800            ;79
0000de  d10c              BNE      |L2.250|
0000e0  e01c              B        |L2.284|
                  |L2.226|
0000e2  b287              UXTH     r7,r0                 ;94
0000e4  0638              LSLS     r0,r7,#24             ;95
0000e6  d506              BPL      |L2.246|
0000e8  6820              LDR      r0,[r4,#0]            ;97
0000ea  b280              UXTH     r0,r0                 ;97
0000ec  ea000008          AND      r0,r0,r8              ;97
0000f0  6020              STR      r0,[r4,#0]            ;97
0000f2  f7fffffe          BL       In0_Process
                  |L2.246|
0000f6  0538              LSLS     r0,r7,#20             ;100
0000f8  d507              BPL      |L2.266|
                  |L2.250|
0000fa  6820              LDR      r0,[r4,#0]            ;102
0000fc  b280              UXTH     r0,r0                 ;102
0000fe  ea00000b          AND      r0,r0,r11             ;102
000102  6020              STR      r0,[r4,#0]            ;102
000104  f7fffffe          BL       Setup0_Process
000108  e008              B        |L2.284|
                  |L2.266|
00010a  0438              LSLS     r0,r7,#16             ;106
00010c  d506              BPL      |L2.284|
00010e  6820              LDR      r0,[r4,#0]            ;108
000110  b280              UXTH     r0,r0                 ;108
000112  ea00000b          AND      r0,r0,r11             ;108
000116  6020              STR      r0,[r4,#0]            ;108
000118  f7fffffe          BL       Out0_Process
                  |L2.284|
00011c  6820              LDR      r0,[r4,#0]            ;115
00011e  f64b718f          MOV      r1,#0xbf8f            ;115
000122  b280              UXTH     r0,r0                 ;115
000124  f8ba2000          LDRH     r2,[r10,#0]           ;115  ; SaveRState
000128  4008              ANDS     r0,r0,r1              ;115
00012a  04d3              LSLS     r3,r2,#19             ;115
00012c  d501              BPL      |L2.306|
00012e  f4805080          EOR      r0,r0,#0x1000         ;115
                  |L2.306|
000132  0492              LSLS     r2,r2,#18             ;115
000134  d501              BPL      |L2.314|
000136  f4805000          EOR      r0,r0,#0x2000         ;115
                  |L2.314|
00013a  6020              STR      r0,[r4,#0]            ;115
00013c  6820              LDR      r0,[r4,#0]            ;116
00013e  f64872bf          MOV      r2,#0x8fbf            ;116
000142  b280              UXTH     r0,r0                 ;116
000144  f8ba1002          LDRH     r1,[r10,#2]           ;116  ; SaveTState
000148  4010              ANDS     r0,r0,r2              ;116
00014a  06ca              LSLS     r2,r1,#27             ;116
00014c  d501              BPL      |L2.338|
00014e  f0800010          EOR      r0,r0,#0x10           ;116
                  |L2.338|
000152  0689              LSLS     r1,r1,#26             ;116
000154  d501              BPL      |L2.346|
000156  f0800020          EOR      r0,r0,#0x20           ;116
                  |L2.346|
00015a  6020              STR      r0,[r4,#0]            ;116
00015c  e78f              B        |L2.126|
;;;147    
                          ENDP

00015e  0000              DCW      0x0000
                  |L2.352|
                          DCD      ||.data||
                  |L2.356|
                          DCD      EPindex
                  |L2.360|
                          DCD      0x40005c00
                  |L2.364|
                          DCD      wIstr
                  |L2.368|
                          DCD      pEpInt_OUT
                  |L2.372|
                          DCD      pEpInt_IN

                          AREA ||.data||, DATA, ALIGN=1

                  SaveRState
000000  0000              DCB      0x00,0x00
                  SaveTState
000002  0000              DCB      0x00,0x00
