; generated by ARM C/C++ Compiler with , RVCT4.0 [Build 524] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\Obj\usb_core.o --depend=.\Obj\usb_core.d --device=DARMSTM --apcs=interwork -O3 -I.\usb_library\inc -Id:\Keil\ARM\INC\ST\STM32F10x -D__MICROLIB -DVECT_TAB_FLASH --omf_browse=.\Obj\usb_core.crf usb_library\src\usb_core.c]
                          THUMB

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

                  DataStageIn PROC
;;;482    *******************************************************************************/
;;;483    void DataStageIn(void)
000000  e92d47f0          PUSH     {r4-r10,lr}
;;;484    {
;;;485      ENDPOINT_INFO *pEPinfo = &pInformation->Ctrl_Info;
000004  f8df9074          LDR      r9,|L1.124|
;;;486      u32 save_wLength = pEPinfo->Usb_wLength;
;;;487      u32 ControlState = pInformation->ControlState;
;;;488    
;;;489      u8 *DataBuffer;
;;;490      u32 Length;
;;;491    
;;;492      if ((save_wLength == 0) && (ControlState == LAST_IN_DATA))
;;;493      {
;;;494        /* no more data to send so STALL the TX Status*/
;;;495        ControlState = WAIT_STATUS_OUT;
;;;496        vSetEPTxStatus(EP_TX_STALL);
000008  f8df8074          LDR      r8,|L1.128|
00000c  f8d91000          LDR      r1,[r9,#0]            ;485  ; pInformation
000010  f1010410          ADD      r4,r1,#0x10           ;485
000014  8a08              LDRH     r0,[r1,#0x10]         ;486
000016  7a09              LDRB     r1,[r1,#8]            ;487
000018  b930              CBNZ     r0,|L1.40|
00001a  2904              CMP      r1,#4                 ;492
00001c  d104              BNE      |L1.40|
00001e  2607              MOVS     r6,#7                 ;495
000020  2110              MOVS     r1,#0x10
000022  f8a81000          STRH     r1,[r8,#0]
;;;497        goto Expect_Status_Out;
000026  e024              B        |L1.114|
                  |L1.40|
;;;498      }
;;;499    
;;;500      Length = pEPinfo->PacketSize;
000028  88a5              LDRH     r5,[r4,#4]
;;;501      ControlState = (save_wLength <= Length) ? LAST_IN_DATA : IN_DATA;
00002a  2604              MOVS     r6,#4
00002c  42a8              CMP      r0,r5
00002e  d900              BLS      |L1.50|
000030  2602              MOVS     r6,#2
                  |L1.50|
;;;502    
;;;503      if (Length > save_wLength)
000032  4285              CMP      r5,r0
000034  d900              BLS      |L1.56|
;;;504      {
;;;505        Length = save_wLength;
000036  4605              MOV      r5,r0
                  |L1.56|
;;;506      }
;;;507    
;;;508      DataBuffer = (*pEPinfo->CopyData)(Length);
000038  b2a8              UXTH     r0,r5
00003a  68a1              LDR      r1,[r4,#8]
00003c  4607              MOV      r7,r0
00003e  4788              BLX      r1
000040  4682              MOV      r10,r0
;;;509    
;;;510      UserToPMABufferCopy(DataBuffer, GetEPTxAddr(ENDP0), Length);
000042  2000              MOVS     r0,#0
000044  f7fffffe          BL       GetEPTxAddr
000048  4601              MOV      r1,r0
00004a  463a              MOV      r2,r7
00004c  4650              MOV      r0,r10
00004e  f7fffffe          BL       UserToPMABufferCopy
;;;511    
;;;512      SetEPTxCount(ENDP0, Length);
000052  4639              MOV      r1,r7
000054  2000              MOVS     r0,#0
000056  f7fffffe          BL       SetEPTxCount
;;;513    
;;;514      pEPinfo->Usb_wLength -= Length;
00005a  8820              LDRH     r0,[r4,#0]
;;;515      pEPinfo->Usb_wOffset += Length;
;;;516      vSetEPTxStatus(EP_TX_VALID);
00005c  2130              MOVS     r1,#0x30
00005e  1b40              SUBS     r0,r0,r5              ;514
000060  8020              STRH     r0,[r4,#0]            ;514
000062  8860              LDRH     r0,[r4,#2]            ;515
000064  4428              ADD      r0,r0,r5              ;515
000066  8060              STRH     r0,[r4,#2]            ;515
000068  f8a81000          STRH     r1,[r8,#0]
;;;517    
;;;518      USB_StatusOut();/* Expect the host to abort the data IN stage */
00006c  0208              LSLS     r0,r1,#8
00006e  4905              LDR      r1,|L1.132|
000070  8008              STRH     r0,[r1,#0]
                  |L1.114|
;;;519    
;;;520    Expect_Status_Out:
;;;521      pInformation->ControlState = ControlState;
000072  f8d90000          LDR      r0,[r9,#0]  ; pInformation
000076  7206              STRB     r6,[r0,#8]
;;;522    }
000078  e8bd87f0          POP      {r4-r10,pc}
;;;523    
                          ENDP

                  |L1.124|
                          DCD      pInformation
                  |L1.128|
                          DCD      SaveTState
                  |L1.132|
                          DCD      SaveRState

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

                  DataStageOut PROC
;;;425    *******************************************************************************/
;;;426    void DataStageOut(void)
000000  e92d47f0          PUSH     {r4-r10,lr}
;;;427    {
;;;428      ENDPOINT_INFO *pEPinfo = &pInformation->Ctrl_Info;
000004  4e23              LDR      r6,|L2.148|
;;;429      u32 save_rLength;
;;;430    
;;;431      save_rLength = pEPinfo->Usb_rLength;
;;;432    
;;;433      if (pEPinfo->CopyData && save_rLength)
;;;434      {
;;;435        u8 *Buffer;
;;;436        u32 Length;
;;;437    
;;;438        Length = pEPinfo->PacketSize;
;;;439        if (Length > save_rLength)
;;;440        {
;;;441          Length = save_rLength;
;;;442        }
;;;443    
;;;444        Buffer = (*pEPinfo->CopyData)(Length);
;;;445        pEPinfo->Usb_rLength -= Length;
;;;446        pEPinfo->Usb_rOffset += Length;
;;;447    
;;;448        PMAToUserBufferCopy(Buffer, GetEPRxAddr(ENDP0), Length);
;;;449      }
;;;450    
;;;451      if (pEPinfo->Usb_rLength != 0)
;;;452      {
;;;453        vSetEPRxStatus(EP_RX_VALID);/* re-enable for next data reception */
;;;454        SetEPTxCount(ENDP0, 0);
;;;455        vSetEPTxStatus(EP_TX_VALID);/* Expect the host to abort the data OUT stage */
000006  f8df9090          LDR      r9,|L2.152|
00000a  6834              LDR      r4,[r6,#0]            ;431  ; pInformation
00000c  f04f0830          MOV      r8,#0x30
000010  f8340f10          LDRH     r0,[r4,#0x10]!        ;431
000014  68a1              LDR      r1,[r4,#8]            ;433
000016  b1b1              CBZ      r1,|L2.70|
000018  b308              CBZ      r0,|L2.94|
00001a  88a5              LDRH     r5,[r4,#4]            ;438
00001c  4285              CMP      r5,r0                 ;439
00001e  d900              BLS      |L2.34|
000020  4605              MOV      r5,r0                 ;441
                  |L2.34|
000022  b2a8              UXTH     r0,r5                 ;444
000024  4607              MOV      r7,r0                 ;444
000026  4788              BLX      r1                    ;444
000028  4682              MOV      r10,r0                ;444
00002a  8820              LDRH     r0,[r4,#0]            ;445
00002c  1b40              SUBS     r0,r0,r5              ;445
00002e  8020              STRH     r0,[r4,#0]            ;445
000030  8860              LDRH     r0,[r4,#2]            ;446
000032  4428              ADD      r0,r0,r5              ;446
000034  8060              STRH     r0,[r4,#2]            ;446
000036  2000              MOVS     r0,#0                 ;448
000038  f7fffffe          BL       GetEPRxAddr
00003c  4601              MOV      r1,r0                 ;448
00003e  463a              MOV      r2,r7                 ;448
000040  4650              MOV      r0,r10                ;448
000042  f7fffffe          BL       PMAToUserBufferCopy
                  |L2.70|
000046  8820              LDRH     r0,[r4,#0]            ;451
000048  b148              CBZ      r0,|L2.94|
00004a  4914              LDR      r1,|L2.156|
00004c  f44f5040          MOV      r0,#0x3000            ;453
000050  8008              STRH     r0,[r1,#0]            ;453
000052  2100              MOVS     r1,#0                 ;454
000054  4608              MOV      r0,r1                 ;454
000056  f7fffffe          BL       SetEPTxCount
00005a  f8a98000          STRH     r8,[r9,#0]
                  |L2.94|
;;;456      }
;;;457      /* Set the next State*/
;;;458      if (pEPinfo->Usb_rLength >= pEPinfo->PacketSize)
00005e  8820              LDRH     r0,[r4,#0]
000060  88a1              LDRH     r1,[r4,#4]
000062  4288              CMP      r0,r1
000064  d301              BCC      |L2.106|
;;;459      {
;;;460        pInformation->ControlState = OUT_DATA;
000066  2003              MOVS     r0,#3
000068  e001              B        |L2.110|
                  |L2.106|
;;;461      }
;;;462      else
;;;463      {
;;;464        if (pEPinfo->Usb_rLength > 0)
00006a  b120              CBZ      r0,|L2.118|
;;;465        {
;;;466          pInformation->ControlState = LAST_OUT_DATA;
00006c  2005              MOVS     r0,#5
                  |L2.110|
00006e  6831              LDR      r1,[r6,#0]            ;460  ; pInformation
000070  7208              STRB     r0,[r1,#8]            ;460
                  |L2.114|
;;;467        }
;;;468        else if (pEPinfo->Usb_rLength == 0)
;;;469        {
;;;470          pInformation->ControlState = WAIT_STATUS_IN;
;;;471          USB_StatusIn();
;;;472        }
;;;473      }
;;;474    }
000072  e8bd87f0          POP      {r4-r10,pc}
                  |L2.118|
000076  6832              LDR      r2,[r6,#0]            ;470  ; pInformation
000078  2106              MOVS     r1,#6                 ;470
00007a  4b09              LDR      r3,|L2.160|
00007c  7211              STRB     r1,[r2,#8]            ;470
00007e  681a              LDR      r2,[r3,#0]            ;471
000080  2000              MOVS     r0,#0                 ;471
000082  4908              LDR      r1,|L2.164|
000084  b292              UXTH     r2,r2                 ;471
000086  eb010142          ADD      r1,r1,r2,LSL #1       ;471
00008a  6048              STR      r0,[r1,#4]            ;471
00008c  f8a98000          STRH     r8,[r9,#0]            ;471
000090  e7ef              B        |L2.114|
;;;475    
                          ENDP

000092  0000              DCW      0x0000
                  |L2.148|
                          DCD      pInformation
                  |L2.152|
                          DCD      SaveTState
                  |L2.156|
                          DCD      SaveRState
                  |L2.160|
                          DCD      0x40005c50
                  |L2.164|
                          DCD      0x40006000

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

                  Data_Setup0 PROC
;;;654    *******************************************************************************/
;;;655    void Data_Setup0(void)
000000  b570              PUSH     {r4-r6,lr}
;;;656    {
;;;657      u8 *(*CopyRoutine)(u16);
;;;658      RESULT Result;
;;;659      u32 Request_No = pInformation->USBbRequest;
000002  4c55              LDR      r4,|L3.344|
;;;660    
;;;661      u32 Related_Endpoint, Reserved;
;;;662      u32 wOffset, Status;
;;;663    
;;;664    
;;;665    
;;;666      CopyRoutine = NULL;
;;;667      wOffset = 0;
;;;668    
;;;669      if (Request_No == GET_DESCRIPTOR)
;;;670      {
;;;671        if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
;;;672        {
;;;673          u8 wValue1 = pInformation->USBwValue1;
;;;674          if (wValue1 == DEVICE_DESCRIPTOR)
;;;675          {
;;;676            CopyRoutine = pProperty->GetDeviceDescriptor;
000004  4d55              LDR      r5,|L3.348|
000006  6820              LDR      r0,[r4,#0]            ;659  ; pInformation
;;;677          }
;;;678          else if (wValue1 == CONFIG_DESCRIPTOR)
;;;679          {
;;;680            CopyRoutine = pProperty->GetConfigDescriptor;
;;;681          }
;;;682          else if (wValue1 == STRING_DESCRIPTOR)
;;;683          {
;;;684            CopyRoutine = pProperty->GetStringDescriptor;
;;;685          }  /* End of GET_DESCRIPTOR */
;;;686        }
;;;687      }
;;;688    
;;;689      /*GET STATUS*/
;;;690      else if ((Request_No == GET_STATUS) && (pInformation->USBwValue == 0)
;;;691               && (pInformation->USBwLength == 0x0002)
;;;692               && (pInformation->USBwIndex1 == 0))
;;;693      {
;;;694        /* GET STATUS for Device*/
;;;695        if ((Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
;;;696            && (pInformation->USBwIndex == 0))
;;;697        {
;;;698          CopyRoutine = Standard_GetStatus;
;;;699        }
;;;700    
;;;701        /* GET STATUS for Interface*/
;;;702        else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
;;;703        {
;;;704          if (((*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, 0) == USB_SUCCESS)
;;;705              && (pInformation->Current_Configuration != 0))
;;;706          {
;;;707            CopyRoutine = Standard_GetStatus;
;;;708          }
;;;709        }
;;;710    
;;;711        /* GET STATUS for EndPoint*/
;;;712        else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
;;;713        {
;;;714          Related_Endpoint = (pInformation->USBwIndex0 & 0x0f);
;;;715          Reserved = pInformation->USBwIndex0 & 0x70;
;;;716    
;;;717          if (ValBit(pInformation->USBwIndex0, 7))
;;;718          {
;;;719            /*Get Status of endpoint & stall the request if the related_ENdpoint
;;;720            is Disabled*/
;;;721            Status = _GetEPTxStatus(Related_Endpoint);
;;;722          }
;;;723          else
;;;724          {
;;;725            Status = _GetEPRxStatus(Related_Endpoint);
;;;726          }
;;;727    
;;;728          if ((Related_Endpoint < Device_Table.Total_Endpoint) && (Reserved == 0)
;;;729              && (Status != 0))
;;;730          {
;;;731            CopyRoutine = Standard_GetStatus;
;;;732          }
;;;733        }
;;;734    
;;;735      }
;;;736    
;;;737      /*GET CONFIGURATION*/
;;;738      else if (Request_No == GET_CONFIGURATION)
;;;739      {
;;;740        if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
;;;741        {
;;;742          CopyRoutine = Standard_GetConfiguration;
;;;743        }
;;;744      }
;;;745      /*GET INTERFACE*/
;;;746      else if (Request_No == GET_INTERFACE)
;;;747      {
;;;748        if ((Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
;;;749            && (pInformation->Current_Configuration != 0) && (pInformation->USBwValue == 0)
;;;750            && (pInformation->USBwIndex1 == 0) && (pInformation->USBwLength == 0x0001)
;;;751            && ((*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, 0) == USB_SUCCESS))
;;;752        {
;;;753          CopyRoutine = Standard_GetInterface;
;;;754        }
;;;755    
;;;756      }
;;;757    
;;;758    
;;;759      if (CopyRoutine)
;;;760      {
;;;761        pInformation->Ctrl_Info.Usb_wOffset = wOffset;
;;;762        pInformation->Ctrl_Info.CopyData = CopyRoutine;
;;;763        /* sb in the original the cast to word was directly */
;;;764        /* now the cast is made step by step */
;;;765        (*CopyRoutine)(0);
;;;766        Result = USB_SUCCESS;
;;;767      }
;;;768      else
;;;769      {
;;;770        Result = (*pProperty->Class_Data_Setup)(pInformation->USBbRequest);
;;;771        if (Result == USB_NOT_READY)
;;;772        {
;;;773          pInformation->ControlState = PAUSE;
000008  2609              MOVS     r6,#9
00000a  7842              LDRB     r2,[r0,#1]            ;659
00000c  6829              LDR      r1,[r5,#0]            ;669
00000e  2a06              CMP      r2,#6                 ;669
000010  d10f              BNE      |L3.50|
000012  7802              LDRB     r2,[r0,#0]            ;671
000014  0652              LSLS     r2,r2,#25             ;671
000016  d171              BNE      |L3.252|
000018  7880              LDRB     r0,[r0,#2]            ;673
00001a  2801              CMP      r0,#1                 ;674
00001c  d101              BNE      |L3.34|
00001e  69c9              LDR      r1,[r1,#0x1c]         ;676
000020  e063              B        |L3.234|
                  |L3.34|
000022  2802              CMP      r0,#2                 ;678
000024  d101              BNE      |L3.42|
000026  6a09              LDR      r1,[r1,#0x20]         ;680
000028  e05f              B        |L3.234|
                  |L3.42|
00002a  2803              CMP      r0,#3                 ;682
00002c  d166              BNE      |L3.252|
00002e  6a49              LDR      r1,[r1,#0x24]         ;684
000030  e05b              B        |L3.234|
                  |L3.50|
000032  bb8a              CBNZ     r2,|L3.152|
000034  8842              LDRH     r2,[r0,#2]            ;690
000036  2a00              CMP      r2,#0                 ;690
000038  d160              BNE      |L3.252|
00003a  88c2              LDRH     r2,[r0,#6]            ;691
00003c  2a02              CMP      r2,#2                 ;691
00003e  d15d              BNE      |L3.252|
000040  7902              LDRB     r2,[r0,#4]            ;692
000042  2a00              CMP      r2,#0                 ;692
000044  d15a              BNE      |L3.252|
000046  7802              LDRB     r2,[r0,#0]            ;695
000048  0653              LSLS     r3,r2,#25             ;695
00004a  d103              BNE      |L3.84|
00004c  8883              LDRH     r3,[r0,#4]            ;696
00004e  b90b              CBNZ     r3,|L3.84|
                  |L3.80|
000050  4943              LDR      r1,|L3.352|
000052  e04a              B        |L3.234|
                  |L3.84|
000054  f002027f          AND      r2,r2,#0x7f           ;702
000058  2a01              CMP      r2,#1                 ;702
00005a  d10a              BNE      |L3.114|
00005c  698a              LDR      r2,[r1,#0x18]         ;704
00005e  7940              LDRB     r0,[r0,#5]            ;704
000060  2100              MOVS     r1,#0                 ;704
000062  4790              BLX      r2                    ;704
000064  2800              CMP      r0,#0                 ;704
000066  d149              BNE      |L3.252|
000068  6820              LDR      r0,[r4,#0]            ;705  ; pInformation
00006a  7a80              LDRB     r0,[r0,#0xa]          ;705
00006c  2800              CMP      r0,#0                 ;705
00006e  d1ef              BNE      |L3.80|
000070  e044              B        |L3.252|
                  |L3.114|
000072  2a02              CMP      r2,#2                 ;712
000074  d142              BNE      |L3.252|
000076  7940              LDRB     r0,[r0,#5]            ;714
000078  4b3a              LDR      r3,|L3.356|
00007a  0601              LSLS     r1,r0,#24             ;717
00007c  f0000270          AND      r2,r0,#0x70           ;715
000080  f000000f          AND      r0,r0,#0xf            ;714
000084  2900              CMP      r1,#0                 ;717
000086  eb030180          ADD      r1,r3,r0,LSL #2       ;721
00008a  f8d11c00          LDR      r1,[r1,#0xc00]        ;721
00008e  da04              BGE      |L3.154|
000090  f3c11101          UBFX     r1,r1,#4,#2           ;721
000094  0109              LSLS     r1,r1,#4              ;721
000096  e003              B        |L3.160|
                  |L3.152|
000098  e00a              B        |L3.176|
                  |L3.154|
00009a  f3c13101          UBFX     r1,r1,#12,#2          ;725
00009e  0309              LSLS     r1,r1,#12             ;725
                  |L3.160|
0000a0  4b31              LDR      r3,|L3.360|
0000a2  781b              LDRB     r3,[r3,#0]            ;728  ; Device_Table
0000a4  4283              CMP      r3,r0                 ;728
0000a6  d929              BLS      |L3.252|
0000a8  bb42              CBNZ     r2,|L3.252|
0000aa  2900              CMP      r1,#0                 ;729
0000ac  d1d0              BNE      |L3.80|
0000ae  e025              B        |L3.252|
                  |L3.176|
0000b0  2a08              CMP      r2,#8                 ;738
0000b2  d104              BNE      |L3.190|
0000b4  7800              LDRB     r0,[r0,#0]            ;740
0000b6  0640              LSLS     r0,r0,#25             ;740
0000b8  d120              BNE      |L3.252|
0000ba  492c              LDR      r1,|L3.364|
0000bc  e015              B        |L3.234|
                  |L3.190|
0000be  2a0a              CMP      r2,#0xa               ;746
0000c0  d11c              BNE      |L3.252|
0000c2  7802              LDRB     r2,[r0,#0]            ;748
0000c4  f002027f          AND      r2,r2,#0x7f           ;748
0000c8  2a01              CMP      r2,#1                 ;748
0000ca  d117              BNE      |L3.252|
0000cc  7a82              LDRB     r2,[r0,#0xa]          ;749
0000ce  b1aa              CBZ      r2,|L3.252|
0000d0  8842              LDRH     r2,[r0,#2]            ;749
0000d2  b99a              CBNZ     r2,|L3.252|
0000d4  7902              LDRB     r2,[r0,#4]            ;750
0000d6  b98a              CBNZ     r2,|L3.252|
0000d8  88c2              LDRH     r2,[r0,#6]            ;750
0000da  2a01              CMP      r2,#1                 ;750
0000dc  d10e              BNE      |L3.252|
0000de  698a              LDR      r2,[r1,#0x18]         ;751
0000e0  7940              LDRB     r0,[r0,#5]            ;751
0000e2  2100              MOVS     r1,#0                 ;751
0000e4  4790              BLX      r2                    ;751
0000e6  b948              CBNZ     r0,|L3.252|
0000e8  4921              LDR      r1,|L3.368|
                  |L3.234|
0000ea  b139              CBZ      r1,|L3.252|
0000ec  6820              LDR      r0,[r4,#0]            ;761  ; pInformation
0000ee  2200              MOVS     r2,#0                 ;761
0000f0  8242              STRH     r2,[r0,#0x12]         ;761
0000f2  6181              STR      r1,[r0,#0x18]         ;765
0000f4  4610              MOV      r0,r2                 ;765
0000f6  4788              BLX      r1                    ;765
0000f8  2000              MOVS     r0,#0                 ;766
0000fa  e009              B        |L3.272|
                  |L3.252|
0000fc  6829              LDR      r1,[r5,#0]            ;770  ; pProperty
0000fe  6820              LDR      r0,[r4,#0]            ;770  ; pInformation
000100  6909              LDR      r1,[r1,#0x10]         ;770
000102  7840              LDRB     r0,[r0,#1]            ;770
000104  4788              BLX      r1                    ;770
000106  2803              CMP      r0,#3                 ;771
000108  d102              BNE      |L3.272|
00010a  6820              LDR      r0,[r4,#0]  ; pInformation
00010c  7206              STRB     r6,[r0,#8]
;;;774          return;
;;;775        }
;;;776      }
;;;777    
;;;778      if (pInformation->Ctrl_Info.Usb_wLength == 0xFFFF)
;;;779      {
;;;780        /* Data is not ready, wait it */
;;;781        pInformation->ControlState = PAUSE;
;;;782        return;
;;;783      }
;;;784      if ((Result == USB_UNSUPPORT) || (pInformation->Ctrl_Info.Usb_wLength == 0))
;;;785      {
;;;786        /* Unsupported request */
;;;787        pInformation->ControlState = STALLED;
;;;788        return;
;;;789      }
;;;790    
;;;791    
;;;792      if (ValBit(pInformation->USBbmRequestType, 7))
;;;793      {
;;;794        /* Device ==> Host */
;;;795        u32 wLength = pInformation->USBwLength;
;;;796    
;;;797        /* Restrict the data length to be the one host asks */
;;;798        if (pInformation->Ctrl_Info.Usb_wLength > wLength)
;;;799        {
;;;800          pInformation->Ctrl_Info.Usb_wLength = wLength;
;;;801        }
;;;802    
;;;803        pInformation->Ctrl_Info.PacketSize = pProperty->MaxPacketSize;
;;;804        DataStageIn();
;;;805      }
;;;806      else
;;;807      {
;;;808        pInformation->ControlState = OUT_DATA;
;;;809        vSetEPRxStatus(EP_RX_VALID);/* enable for next data reception */
;;;810      }
;;;811    
;;;812      return;
;;;813    }
00010e  bd70              POP      {r4-r6,pc}
                  |L3.272|
000110  6821              LDR      r1,[r4,#0]            ;778  ; pInformation
000112  8a0a              LDRH     r2,[r1,#0x10]         ;778
000114  f5a2437f          SUB      r3,r2,#0xff00         ;778
000118  3bff              SUBS     r3,r3,#0xff           ;778
00011a  d101              BNE      |L3.288|
00011c  720e              STRB     r6,[r1,#8]            ;781
00011e  bd70              POP      {r4-r6,pc}
                  |L3.288|
000120  2802              CMP      r0,#2                 ;784
000122  d000              BEQ      |L3.294|
000124  b912              CBNZ     r2,|L3.300|
                  |L3.294|
000126  2008              MOVS     r0,#8                 ;787
000128  7208              STRB     r0,[r1,#8]            ;787
00012a  bd70              POP      {r4-r6,pc}
                  |L3.300|
00012c  7808              LDRB     r0,[r1,#0]            ;792
00012e  0600              LSLS     r0,r0,#24             ;792
000130  d50b              BPL      |L3.330|
000132  88c8              LDRH     r0,[r1,#6]            ;795
000134  4282              CMP      r2,r0                 ;798
000136  d900              BLS      |L3.314|
000138  8208              STRH     r0,[r1,#0x10]         ;800
                  |L3.314|
00013a  6828              LDR      r0,[r5,#0]            ;803  ; pProperty
00013c  f890002c          LDRB     r0,[r0,#0x2c]         ;803
000140  8288              STRH     r0,[r1,#0x14]         ;803
000142  e8bd4070          POP      {r4-r6,lr}            ;804
000146  f7ffbffe          B.W      DataStageIn
                  |L3.330|
00014a  2003              MOVS     r0,#3                 ;808
00014c  7208              STRB     r0,[r1,#8]            ;808
00014e  4909              LDR      r1,|L3.372|
000150  0300              LSLS     r0,r0,#12             ;809
000152  8008              STRH     r0,[r1,#0]            ;809
000154  bd70              POP      {r4-r6,pc}
;;;814    
                          ENDP

000156  0000              DCW      0x0000
                  |L3.344|
                          DCD      pInformation
                  |L3.348|
                          DCD      pProperty
                  |L3.352|
                          DCD      Standard_GetStatus
                  |L3.356|
                          DCD      0x40005000
                  |L3.360|
                          DCD      Device_Table
                  |L3.364|
                          DCD      Standard_GetConfiguration
                  |L3.368|
                          DCD      Standard_GetInterface
                  |L3.372|
                          DCD      SaveRState

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

                  In0_Process PROC
;;;865    *******************************************************************************/
;;;866    u8 In0_Process(void)
000000  b510              PUSH     {r4,lr}
;;;867    {
;;;868      u32 ControlState = pInformation->ControlState;
000002  4c13              LDR      r4,|L4.80|
000004  6820              LDR      r0,[r4,#0]  ; pInformation
000006  7a01              LDRB     r1,[r0,#8]
;;;869    
;;;870      if ((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA))
000008  2902              CMP      r1,#2
00000a  d001              BEQ      |L4.16|
00000c  2904              CMP      r1,#4
00000e  d104              BNE      |L4.26|
                  |L4.16|
;;;871      {
;;;872        DataStageIn();
000010  f7fffffe          BL       DataStageIn
;;;873        /* ControlState may be changed outside the function */
;;;874        ControlState = pInformation->ControlState;
000014  6820              LDR      r0,[r4,#0]  ; pInformation
000016  7a00              LDRB     r0,[r0,#8]
000018  e013              B        |L4.66|
                  |L4.26|
;;;875      }
;;;876    
;;;877      else if (ControlState == WAIT_STATUS_IN)
00001a  2906              CMP      r1,#6
00001c  d110              BNE      |L4.64|
;;;878      {
;;;879        if ((pInformation->USBbRequest == SET_ADDRESS) &&
00001e  7841              LDRB     r1,[r0,#1]
000020  2905              CMP      r1,#5
000022  d109              BNE      |L4.56|
;;;880            (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT)))
000024  7801              LDRB     r1,[r0,#0]
000026  0649              LSLS     r1,r1,#25
000028  d106              BNE      |L4.56|
;;;881        {
;;;882          SetDeviceAddress(pInformation->USBwValue0);
00002a  78c0              LDRB     r0,[r0,#3]
00002c  f7fffffe          BL       SetDeviceAddress
;;;883          pUser_Standard_Requests->User_SetDeviceAddress();
000030  4808              LDR      r0,|L4.84|
000032  6800              LDR      r0,[r0,#0]  ; pUser_Standard_Requests
000034  6a00              LDR      r0,[r0,#0x20]
000036  4780              BLX      r0
                  |L4.56|
;;;884        }
;;;885        (*pProperty->Process_Status_IN)();
000038  4807              LDR      r0,|L4.88|
00003a  6800              LDR      r0,[r0,#0]  ; pProperty
00003c  6880              LDR      r0,[r0,#8]
00003e  4780              BLX      r0
                  |L4.64|
;;;886        ControlState = STALLED;
;;;887      }
;;;888    
;;;889      else
;;;890      {
;;;891        ControlState = STALLED;
000040  2008              MOVS     r0,#8
                  |L4.66|
;;;892      }
;;;893    
;;;894      pInformation->ControlState = ControlState;
000042  6821              LDR      r1,[r4,#0]  ; pInformation
000044  7208              STRB     r0,[r1,#8]
;;;895    
;;;896      return Post0_Process();
000046  e8bd4010          POP      {r4,lr}
00004a  f7ffbffe          B.W      Post0_Process
;;;897    }
;;;898    
                          ENDP

00004e  0000              DCW      0x0000
                  |L4.80|
                          DCD      pInformation
                  |L4.84|
                          DCD      pUser_Standard_Requests
                  |L4.88|
                          DCD      pProperty

                          AREA ||i.NOP_Process||, CODE, READONLY, ALIGN=1

                  NOP_Process PROC
;;;986    *******************************************************************************/
;;;987    void NOP_Process(void)
000000  4770              BX       lr
;;;988    {
;;;989    }
;;;990    
                          ENDP


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

                  NoData_Setup0 PROC
;;;530    *******************************************************************************/
;;;531    void NoData_Setup0(void)
000000  b570              PUSH     {r4-r6,lr}
;;;532    {
;;;533      RESULT Result = USB_UNSUPPORT;
;;;534      u32 RequestNo = pInformation->USBbRequest;
000002  4d30              LDR      r5,|L6.196|
;;;535      u32 ControlState;
;;;536    
;;;537      if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
000004  6828              LDR      r0,[r5,#0]  ; pInformation
000006  7801              LDRB     r1,[r0,#0]
000008  7844              LDRB     r4,[r0,#1]            ;534
00000a  064a              LSLS     r2,r1,#25
00000c  d128              BNE      |L6.96|
;;;538      {
;;;539        /* Device Request*/
;;;540        /* SET_CONFIGURATION*/
;;;541        if (RequestNo == SET_CONFIGURATION)
00000e  2c09              CMP      r4,#9
000010  d102              BNE      |L6.24|
;;;542        {
;;;543          Result = Standard_SetConfiguration();
000012  f7fffffe          BL       Standard_SetConfiguration
000016  e037              B        |L6.136|
                  |L6.24|
;;;544        }
;;;545    
;;;546        /*SET ADDRESS*/
;;;547        else if (RequestNo == SET_ADDRESS)
000018  2c05              CMP      r4,#5
00001a  d109              BNE      |L6.48|
;;;548        {
;;;549          if ((pInformation->USBwValue0 > 127) || (pInformation->USBwValue1 != 0)
00001c  78c1              LDRB     r1,[r0,#3]
00001e  297f              CMP      r1,#0x7f
000020  d83e              BHI      |L6.160|
000022  7881              LDRB     r1,[r0,#2]
000024  2900              CMP      r1,#0
000026  d13b              BNE      |L6.160|
;;;550              || (pInformation->USBwIndex != 0)
000028  8881              LDRH     r1,[r0,#4]
00002a  bbb9              CBNZ     r1,|L6.156|
;;;551              || (pInformation->Current_Configuration != 0))
00002c  7a80              LDRB     r0,[r0,#0xa]
00002e  e036              B        |L6.158|
                  |L6.48|
;;;552            /* Device Address should be 127 or less*/
;;;553          {
;;;554            ControlState = STALLED;
;;;555            goto exit_NoData_Setup0;
;;;556          }
;;;557          else
;;;558          {
;;;559            Result = USB_SUCCESS;
;;;560          }
;;;561        }
;;;562        /*SET FEATURE for Device*/
;;;563        else if (RequestNo == SET_FEATURE)
000030  2c03              CMP      r4,#3
000032  d10a              BNE      |L6.74|
;;;564        {
;;;565          if ((pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP)
000034  78c1              LDRB     r1,[r0,#3]
000036  2901              CMP      r1,#1
000038  d127              BNE      |L6.138|
;;;566              && (pInformation->USBwIndex == 0)
00003a  8881              LDRH     r1,[r0,#4]
00003c  bb29              CBNZ     r1,|L6.138|
;;;567              && (ValBit(pInformation->Current_Feature, 5)))
00003e  7a40              LDRB     r0,[r0,#9]
000040  0680              LSLS     r0,r0,#26
000042  d522              BPL      |L6.138|
;;;568          {
;;;569            Result = Standard_SetDeviceFeature();
000044  f7fffffe          BL       Standard_SetDeviceFeature
000048  e01e              B        |L6.136|
                  |L6.74|
;;;570          }
;;;571          else
;;;572          {
;;;573            Result = USB_UNSUPPORT;
;;;574          }
;;;575        }
;;;576        /*Clear FEATURE for Device */
;;;577        else if (RequestNo == CLEAR_FEATURE)
00004a  2c01              CMP      r4,#1
00004c  d11d              BNE      |L6.138|
;;;578        {
;;;579          if (pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP
00004e  78c1              LDRB     r1,[r0,#3]
000050  2901              CMP      r1,#1
000052  d11a              BNE      |L6.138|
;;;580              && pInformation->USBwIndex == 0
000054  8881              LDRH     r1,[r0,#4]
000056  b9c1              CBNZ     r1,|L6.138|
;;;581              && ValBit(pInformation->Current_Feature, 5))
000058  7a40              LDRB     r0,[r0,#9]
00005a  0680              LSLS     r0,r0,#26
00005c  d515              BPL      |L6.138|
00005e  e00c              B        |L6.122|
                  |L6.96|
;;;582          {
;;;583            Result = Standard_ClearFeature();
;;;584          }
;;;585          else
;;;586          {
;;;587            Result = USB_UNSUPPORT;
;;;588          }
;;;589        }
;;;590    
;;;591      }
;;;592    
;;;593      /* Interface Request*/
;;;594      else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
000060  f001007f          AND      r0,r1,#0x7f
000064  2801              CMP      r0,#1
000066  d104              BNE      |L6.114|
;;;595      {
;;;596        /*SET INTERFACE*/
;;;597        if (RequestNo == SET_INTERFACE)
000068  2c0b              CMP      r4,#0xb
00006a  d10e              BNE      |L6.138|
;;;598        {
;;;599          Result = Standard_SetInterface();
00006c  f7fffffe          BL       Standard_SetInterface
000070  e00a              B        |L6.136|
                  |L6.114|
;;;600        }
;;;601      }
;;;602    
;;;603      /* EndPoint Request*/
;;;604      else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000072  2802              CMP      r0,#2
000074  d109              BNE      |L6.138|
;;;605      {
;;;606        /*CLEAR FEATURE for EndPoint*/
;;;607        if (RequestNo == CLEAR_FEATURE)
000076  2c01              CMP      r4,#1
000078  d102              BNE      |L6.128|
                  |L6.122|
;;;608        {
;;;609          Result = Standard_ClearFeature();
00007a  f7fffffe          BL       Standard_ClearFeature
00007e  e003              B        |L6.136|
                  |L6.128|
;;;610        }
;;;611        /* SET FEATURE for EndPoint*/
;;;612        else if (RequestNo == SET_FEATURE)
000080  2c03              CMP      r4,#3
000082  d102              BNE      |L6.138|
;;;613        {
;;;614          Result = Standard_SetEndPointFeature();
000084  f7fffffe          BL       Standard_SetEndPointFeature
                  |L6.136|
;;;615        }
;;;616      }
;;;617      else
;;;618      {
;;;619        Result = USB_UNSUPPORT;
;;;620      }
;;;621    
;;;622    
;;;623      if (Result != USB_SUCCESS)
000088  b160              CBZ      r0,|L6.164|
                  |L6.138|
;;;624      {
;;;625        Result = (*pProperty->Class_NoData_Setup)(RequestNo);
00008a  480f              LDR      r0,|L6.200|
00008c  6800              LDR      r0,[r0,#0]  ; pProperty
00008e  6941              LDR      r1,[r0,#0x14]
000090  b2e0              UXTB     r0,r4
000092  4788              BLX      r1
;;;626        if (Result == USB_NOT_READY)
000094  2803              CMP      r0,#3
000096  d102              BNE      |L6.158|
;;;627        {
;;;628          ControlState = PAUSE;
000098  2009              MOVS     r0,#9
;;;629          goto exit_NoData_Setup0;
00009a  e00f              B        |L6.188|
                  |L6.156|
00009c  e000              B        |L6.160|
                  |L6.158|
;;;630        }
;;;631      }
;;;632    
;;;633      if (Result != USB_SUCCESS)
00009e  b108              CBZ      r0,|L6.164|
                  |L6.160|
;;;634      {
;;;635        ControlState = STALLED;
0000a0  2008              MOVS     r0,#8
;;;636        goto exit_NoData_Setup0;
0000a2  e00b              B        |L6.188|
                  |L6.164|
;;;637      }
;;;638    
;;;639      ControlState = WAIT_STATUS_IN;/* After no data stage SETUP */
;;;640    
;;;641      USB_StatusIn();
0000a4  4a09              LDR      r2,|L6.204|
0000a6  2006              MOVS     r0,#6                 ;639
0000a8  6813              LDR      r3,[r2,#0]
0000aa  2100              MOVS     r1,#0
0000ac  4a08              LDR      r2,|L6.208|
0000ae  b29b              UXTH     r3,r3
0000b0  eb020243          ADD      r2,r2,r3,LSL #1
0000b4  6051              STR      r1,[r2,#4]
0000b6  4a07              LDR      r2,|L6.212|
0000b8  2130              MOVS     r1,#0x30
0000ba  8011              STRH     r1,[r2,#0]
                  |L6.188|
;;;642    
;;;643    exit_NoData_Setup0:
;;;644      pInformation->ControlState = ControlState;
0000bc  6829              LDR      r1,[r5,#0]  ; pInformation
0000be  7208              STRB     r0,[r1,#8]
;;;645      return;
;;;646    }
0000c0  bd70              POP      {r4-r6,pc}
;;;647    
                          ENDP

0000c2  0000              DCW      0x0000
                  |L6.196|
                          DCD      pInformation
                  |L6.200|
                          DCD      pProperty
                  |L6.204|
                          DCD      0x40005c50
                  |L6.208|
                          DCD      0x40006000
                  |L6.212|
                          DCD      SaveTState

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

                  Out0_Process PROC
;;;905    *******************************************************************************/
;;;906    u8 Out0_Process(void)
000000  b510              PUSH     {r4,lr}
;;;907    {
;;;908      u32 ControlState = pInformation->ControlState;
000002  4c0c              LDR      r4,|L7.52|
000004  6820              LDR      r0,[r4,#0]  ; pInformation
000006  7a00              LDRB     r0,[r0,#8]
;;;909    
;;;910      if ((ControlState == OUT_DATA) || (ControlState == LAST_OUT_DATA))
000008  2803              CMP      r0,#3
00000a  d001              BEQ      |L7.16|
00000c  2805              CMP      r0,#5
00000e  d104              BNE      |L7.26|
                  |L7.16|
;;;911      {
;;;912        DataStageOut();
000010  f7fffffe          BL       DataStageOut
;;;913        ControlState = pInformation->ControlState; /* may be changed outside the function */
000014  6820              LDR      r0,[r4,#0]  ; pInformation
000016  7a00              LDRB     r0,[r0,#8]
000018  e006              B        |L7.40|
                  |L7.26|
;;;914      }
;;;915    
;;;916      else if (ControlState == WAIT_STATUS_OUT)
00001a  2807              CMP      r0,#7
00001c  d103              BNE      |L7.38|
;;;917      {
;;;918        (*pProperty->Process_Status_OUT)();
00001e  4806              LDR      r0,|L7.56|
000020  6800              LDR      r0,[r0,#0]  ; pProperty
000022  68c0              LDR      r0,[r0,#0xc]
000024  4780              BLX      r0
                  |L7.38|
;;;919        ControlState = STALLED;
;;;920      }
;;;921    
;;;922      else if ((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA))
;;;923      {
;;;924        /* host aborts the transfer before finish */
;;;925        ControlState = STALLED;
000026  2008              MOVS     r0,#8
                  |L7.40|
;;;926      }
;;;927    
;;;928      /* Unexpect state, STALL the endpoint */
;;;929      else
;;;930      {
;;;931        ControlState = STALLED;
;;;932      }
;;;933    
;;;934      pInformation->ControlState = ControlState;
000028  6821              LDR      r1,[r4,#0]  ; pInformation
00002a  7208              STRB     r0,[r1,#8]
;;;935    
;;;936      return Post0_Process();
00002c  e8bd4010          POP      {r4,lr}
000030  f7ffbffe          B.W      Post0_Process
;;;937    }
;;;938    
                          ENDP

                  |L7.52|
                          DCD      pInformation
                  |L7.56|
                          DCD      pProperty

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

                  Post0_Process PROC
;;;946    *******************************************************************************/
;;;947    u8 Post0_Process(void)
000000  b510              PUSH     {r4,lr}
;;;948    {
;;;949      SetEPRxCount(ENDP0, Device_Property.MaxPacketSize);
000002  480b              LDR      r0,|L8.48|
000004  f890102c          LDRB     r1,[r0,#0x2c]  ; Device_Property
000008  2000              MOVS     r0,#0
00000a  f7fffffe          BL       SetEPRxCount
;;;950    
;;;951      if (pInformation->ControlState == STALLED)
00000e  4809              LDR      r0,|L8.52|
000010  6800              LDR      r0,[r0,#0]  ; pInformation
000012  7a01              LDRB     r1,[r0,#8]
000014  2908              CMP      r1,#8
000016  d105              BNE      |L8.36|
;;;952      {
;;;953        vSetEPRxStatus(EP_RX_STALL);
000018  4a07              LDR      r2,|L8.56|
00001a  0248              LSLS     r0,r1,#9
00001c  8010              STRH     r0,[r2,#0]
;;;954        vSetEPTxStatus(EP_TX_STALL);
00001e  4a07              LDR      r2,|L8.60|
000020  2010              MOVS     r0,#0x10
000022  8010              STRH     r0,[r2,#0]
                  |L8.36|
;;;955      }
;;;956    
;;;957      return (pInformation->ControlState == PAUSE);
000024  2001              MOVS     r0,#1
000026  2909              CMP      r1,#9
000028  d000              BEQ      |L8.44|
00002a  2000              MOVS     r0,#0
                  |L8.44|
;;;958    }
00002c  bd10              POP      {r4,pc}
;;;959    
                          ENDP

00002e  0000              DCW      0x0000
                  |L8.48|
                          DCD      Device_Property
                  |L8.52|
                          DCD      pInformation
                  |L8.56|
                          DCD      SaveRState
                  |L8.60|
                          DCD      SaveTState

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

                  SetDeviceAddress PROC
;;;966    *******************************************************************************/
;;;967    void SetDeviceAddress(u8 Val)
000000  b5f0              PUSH     {r4-r7,lr}
;;;968    {
;;;969      u32 i;
;;;970      u32 nEP = Device_Table.Total_Endpoint;
000002  490c              LDR      r1,|L9.52|
;;;971    
;;;972      /* set address in every used endpoint */
;;;973      for (i = 0; i < nEP; i++)
;;;974      {
;;;975        _SetEPAddress((u8)i, (u8)i);
000004  4f0c              LDR      r7,|L9.56|
000006  780e              LDRB     r6,[r1,#0]            ;970  ; Device_Table
000008  2100              MOVS     r1,#0                 ;973
00000a  f648758f          MOV      r5,#0x8f8f
00000e  e00a              B        |L9.38|
                  |L9.16|
000010  b2ca              UXTB     r2,r1
000012  eb070382          ADD      r3,r7,r2,LSL #2
000016  f8d34c00          LDR      r4,[r3,#0xc00]
00001a  b2a4              UXTH     r4,r4
00001c  402c              ANDS     r4,r4,r5
00001e  4314              ORRS     r4,r4,r2
000020  f8c34c00          STR      r4,[r3,#0xc00]
000024  1c49              ADDS     r1,r1,#1              ;973
                  |L9.38|
000026  42b1              CMP      r1,r6                 ;973
000028  d3f2              BCC      |L9.16|
;;;976      } /* for */
;;;977      _SetDADDR(Val | DADDR_EF); /* set device address and enable function */
00002a  f0400080          ORR      r0,r0,#0x80
00002e  f8c70c4c          STR      r0,[r7,#0xc4c]
;;;978    }
000032  bdf0              POP      {r4-r7,pc}
;;;979    
                          ENDP

                  |L9.52|
                          DCD      Device_Table
                  |L9.56|
                          DCD      0x40005000

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

                  Setup0_Process PROC
;;;821    *******************************************************************************/
;;;822    u8 Setup0_Process(void)
000000  b570              PUSH     {r4-r6,lr}
;;;823    {
000002  4817              LDR      r0,|L10.96|
;;;824    
;;;825      union
;;;826      {
;;;827        u8* b;
;;;828        u16* w;
;;;829      } pBuf;
;;;830    
;;;831      pBuf.b = PMAAddr + (u8 *)(_GetEPRxAddr(ENDP0) * 2); /* *2 for 32 bits addr */
000004  6801              LDR      r1,[r0,#0]
000006  4817              LDR      r0,|L10.100|
000008  b289              UXTH     r1,r1
00000a  eb000141          ADD      r1,r0,r1,LSL #1
00000e  6889              LDR      r1,[r1,#8]
;;;832    
;;;833      if (pInformation->ControlState != PAUSE)
000010  4d15              LDR      r5,|L10.104|
000012  b289              UXTH     r1,r1                 ;831
000014  eb000441          ADD      r4,r0,r1,LSL #1       ;831
000018  6828              LDR      r0,[r5,#0]  ; pInformation
00001a  7a01              LDRB     r1,[r0,#8]
00001c  2909              CMP      r1,#9
00001e  d011              BEQ      |L10.68|
;;;834      {
;;;835        pInformation->USBbmRequestType = *pBuf.b++; /* bmRequestType */
000020  7821              LDRB     r1,[r4,#0]
000022  7001              STRB     r1,[r0,#0]
;;;836        pInformation->USBbRequest = *pBuf.b++; /* bRequest */
000024  f8141f01          LDRB     r1,[r4,#1]!
000028  7041              STRB     r1,[r0,#1]
00002a  1c64              ADDS     r4,r4,#1
;;;837        pBuf.w++;  /* word not accessed because of 32 bits addressing */
;;;838        pInformation->USBwValue = ByteSwap(*pBuf.w++); /* wValue */
00002c  8860              LDRH     r0,[r4,#2]
00002e  f7fffffe          BL       ByteSwap
000032  6829              LDR      r1,[r5,#0]  ; pInformation
000034  8048              STRH     r0,[r1,#2]
;;;839        pBuf.w++;  /* word not accessed because of 32 bits addressing */
;;;840        pInformation->USBwIndex  = ByteSwap(*pBuf.w++); /* wIndex */
000036  88e0              LDRH     r0,[r4,#6]
000038  f7fffffe          BL       ByteSwap
00003c  6829              LDR      r1,[r5,#0]  ; pInformation
00003e  8088              STRH     r0,[r1,#4]
;;;841        pBuf.w++;  /* word not accessed because of 32 bits addressing */
;;;842        pInformation->USBwLength = *pBuf.w; /* wLength */
000040  8960              LDRH     r0,[r4,#0xa]
000042  80c8              STRH     r0,[r1,#6]
                  |L10.68|
;;;843      }
;;;844    
;;;845      pInformation->ControlState = SETTING_UP;
000044  6828              LDR      r0,[r5,#0]  ; pInformation
000046  2101              MOVS     r1,#1
000048  7201              STRB     r1,[r0,#8]
;;;846      if (pInformation->USBwLength == 0)
00004a  88c0              LDRH     r0,[r0,#6]
00004c  b910              CBNZ     r0,|L10.84|
;;;847      {
;;;848        /* Setup with no data stage */
;;;849        NoData_Setup0();
00004e  f7fffffe          BL       NoData_Setup0
000052  e001              B        |L10.88|
                  |L10.84|
;;;850      }
;;;851      else
;;;852      {
;;;853        /* Setup with data stage */
;;;854        Data_Setup0();
000054  f7fffffe          BL       Data_Setup0
                  |L10.88|
;;;855      }
;;;856      return Post0_Process();
000058  e8bd4070          POP      {r4-r6,lr}
00005c  f7ffbffe          B.W      Post0_Process
;;;857    }
;;;858    
                          ENDP

                  |L10.96|
                          DCD      0x40005c50
                  |L10.100|
                          DCD      0x40006000
                  |L10.104|
                          DCD      pInformation

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

                  Standard_ClearFeature PROC
;;;235    *******************************************************************************/
;;;236    RESULT Standard_ClearFeature(void)
000000  b570              PUSH     {r4-r6,lr}
;;;237    {
;;;238      u32     Type_Rec = Type_Recipient;
000002  4837              LDR      r0,|L11.224|
000004  6801              LDR      r1,[r0,#0]  ; pInformation
000006  7808              LDRB     r0,[r1,#0]
000008  f010007f          ANDS     r0,r0,#0x7f
;;;239      u32     Status;
;;;240    
;;;241    
;;;242      if (Type_Rec == (STANDARD_REQUEST | DEVICE_RECIPIENT))
00000c  d104              BNE      |L11.24|
;;;243      {/*Device Clear Feature*/
;;;244        ClrBit(pInformation->Current_Feature, 5);
00000e  7a48              LDRB     r0,[r1,#9]
000010  f00000df          AND      r0,r0,#0xdf
000014  7248              STRB     r0,[r1,#9]
;;;245        return USB_SUCCESS;
000016  e05c              B        |L11.210|
                  |L11.24|
;;;246      }
;;;247      else if (Type_Rec == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000018  2802              CMP      r0,#2
00001a  d15e              BNE      |L11.218|
;;;248      {/*EndPoint Clear Feature*/
;;;249        DEVICE* pDev;
;;;250        u32 Related_Endpoint;
;;;251        u32 wIndex0;
;;;252        u32 rEP;
;;;253    
;;;254        if ((pInformation->USBwValue != ENDPOINT_STALL)
00001c  8848              LDRH     r0,[r1,#2]
00001e  2800              CMP      r0,#0
000020  d15b              BNE      |L11.218|
;;;255            || (pInformation->USBwIndex1 != 0))
000022  7908              LDRB     r0,[r1,#4]
000024  2800              CMP      r0,#0
000026  d158              BNE      |L11.218|
;;;256        {
;;;257          return USB_UNSUPPORT;
;;;258        }
;;;259    
;;;260        pDev = &Device_Table;
;;;261        wIndex0 = pInformation->USBwIndex0;
000028  794a              LDRB     r2,[r1,#5]
;;;262        rEP = wIndex0 & ~0x80;
;;;263        Related_Endpoint = ENDP0 + rEP;
;;;264    
;;;265        if (ValBit(pInformation->USBwIndex0, 7))
;;;266        {
;;;267          /*Get Status of endpoint & stall the request if the related_ENdpoint
;;;268          is Disabled*/
;;;269          Status = _GetEPTxStatus(Related_Endpoint);
00002a  4c2f              LDR      r4,|L11.232|
00002c  0613              LSLS     r3,r2,#24             ;265
00002e  f0220080          BIC      r0,r2,#0x80           ;262
000032  2b00              CMP      r3,#0                 ;265
000034  eb040380          ADD      r3,r4,r0,LSL #2
000038  4d2a              LDR      r5,|L11.228|
00003a  f8d33c00          LDR      r3,[r3,#0xc00]
00003e  da03              BGE      |L11.72|
000040  f3c31301          UBFX     r3,r3,#4,#2
000044  011b              LSLS     r3,r3,#4
000046  e002              B        |L11.78|
                  |L11.72|
;;;270        }
;;;271        else
;;;272        {
;;;273          Status = _GetEPRxStatus(Related_Endpoint);
000048  f3c33301          UBFX     r3,r3,#12,#2
00004c  031b              LSLS     r3,r3,#12
                  |L11.78|
;;;274        }
;;;275    
;;;276        if ((rEP >= pDev->Total_Endpoint) || (Status == 0)
00004e  782e              LDRB     r6,[r5,#0]
000050  4286              CMP      r6,r0
000052  d942              BLS      |L11.218|
000054  b3f3              CBZ      r3,|L11.212|
;;;277            || (pInformation->Current_Configuration == 0))
000056  7a89              LDRB     r1,[r1,#0xa]
000058  b3e1              CBZ      r1,|L11.212|
;;;278        {
;;;279          return USB_UNSUPPORT;
;;;280        }
;;;281    
;;;282    
;;;283        if (wIndex0 & 0x80)
00005a  0611              LSLS     r1,r2,#24
00005c  d510              BPL      |L11.128|
;;;284        {
;;;285          /* IN endpoint */
;;;286          if (_GetTxStallStatus(Related_Endpoint ))
00005e  eb040180          ADD      r1,r4,r0,LSL #2
000062  f8d11c00          LDR      r1,[r1,#0xc00]
000066  f3c11101          UBFX     r1,r1,#4,#2
00006a  2901              CMP      r1,#1
00006c  d12d              BNE      |L11.202|
;;;287          {
;;;288            ClearDTOG_TX(Related_Endpoint);
00006e  b2c0              UXTB     r0,r0
000070  4604              MOV      r4,r0
000072  f7fffffe          BL       ClearDTOG_TX
;;;289            SetEPTxStatus(Related_Endpoint, EP_TX_VALID);
000076  2130              MOVS     r1,#0x30
000078  4620              MOV      r0,r4
00007a  f7fffffe          BL       SetEPTxStatus
00007e  e024              B        |L11.202|
                  |L11.128|
;;;290          }
;;;291        }
;;;292        else
;;;293        {
;;;294          /* OUT endpoint */
;;;295          if (_GetRxStallStatus(Related_Endpoint))
000080  eb040580          ADD      r5,r4,r0,LSL #2
000084  f8d51c00          LDR      r1,[r5,#0xc00]
000088  f3c13101          UBFX     r1,r1,#12,#2
00008c  2901              CMP      r1,#1
00008e  d11c              BNE      |L11.202|
;;;296          {
;;;297            if (Related_Endpoint == ENDP0)
;;;298            {
;;;299              /* After clear the STALL, enable the default endpoint receiver */
;;;300              SetEPRxCount(Related_Endpoint, Device_Property.MaxPacketSize);
;;;301              _SetEPRxStatus(Related_Endpoint, EP_RX_VALID);
000090  f64b768f          MOV      r6,#0xbf8f
000094  b970              CBNZ     r0,|L11.180|
000096  4815              LDR      r0,|L11.236|
000098  f890102c          LDRB     r1,[r0,#0x2c]         ;300  ; Device_Property
00009c  2000              MOVS     r0,#0                 ;300
00009e  f7fffffe          BL       SetEPRxCount
0000a2  f8d40c00          LDR      r0,[r4,#0xc00]
0000a6  b280              UXTH     r0,r0
0000a8  4030              ANDS     r0,r0,r6
0000aa  f4805040          EOR      r0,r0,#0x3000
0000ae  f8c40c00          STR      r0,[r4,#0xc00]
0000b2  e00a              B        |L11.202|
                  |L11.180|
;;;302            }
;;;303            else
;;;304            {
;;;305              ClearDTOG_RX(Related_Endpoint);
0000b4  b2c0              UXTB     r0,r0
0000b6  f7fffffe          BL       ClearDTOG_RX
;;;306              _SetEPRxStatus(Related_Endpoint, EP_RX_VALID);
0000ba  f8d50c00          LDR      r0,[r5,#0xc00]
0000be  b280              UXTH     r0,r0
0000c0  4030              ANDS     r0,r0,r6
0000c2  f4805040          EOR      r0,r0,#0x3000
0000c6  f8c50c00          STR      r0,[r5,#0xc00]
                  |L11.202|
;;;307            }
;;;308          }
;;;309        }
;;;310        pUser_Standard_Requests->User_ClearFeature();
0000ca  4809              LDR      r0,|L11.240|
0000cc  6800              LDR      r0,[r0,#0]  ; pUser_Standard_Requests
0000ce  6940              LDR      r0,[r0,#0x14]
0000d0  4780              BLX      r0
                  |L11.210|
;;;311        return USB_SUCCESS;
0000d2  e000              B        |L11.214|
                  |L11.212|
0000d4  e001              B        |L11.218|
                  |L11.214|
0000d6  2000              MOVS     r0,#0
;;;312      }
;;;313    
;;;314      return USB_UNSUPPORT;
;;;315    }
0000d8  bd70              POP      {r4-r6,pc}
                  |L11.218|
0000da  2002              MOVS     r0,#2                 ;314
0000dc  bd70              POP      {r4-r6,pc}
;;;316    
                          ENDP

0000de  0000              DCW      0x0000
                  |L11.224|
                          DCD      pInformation
                  |L11.228|
                          DCD      Device_Table
                  |L11.232|
                          DCD      0x40005000
                  |L11.236|
                          DCD      Device_Property
                  |L11.240|
                          DCD      pUser_Standard_Requests

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

                  Standard_GetConfiguration PROC
;;;55     *******************************************************************************/
;;;56     u8 *Standard_GetConfiguration(u16 Length)
000000  b510              PUSH     {r4,lr}
;;;57     {
;;;58       if (Length == 0)
;;;59       {
;;;60         pInformation->Ctrl_Info.Usb_wLength =
000002  4c07              LDR      r4,|L12.32|
000004  b920              CBNZ     r0,|L12.16|
000006  6821              LDR      r1,[r4,#0]  ; pInformation
000008  2001              MOVS     r0,#1
00000a  8208              STRH     r0,[r1,#0x10]
;;;61           sizeof(pInformation->Current_Configuration);
;;;62         return 0;
00000c  2000              MOVS     r0,#0
;;;63       }
;;;64       pUser_Standard_Requests->User_GetConfiguration();
;;;65       return (u8 *)&pInformation->Current_Configuration;
;;;66     }
00000e  bd10              POP      {r4,pc}
                  |L12.16|
000010  4804              LDR      r0,|L12.36|
000012  6800              LDR      r0,[r0,#0]            ;64  ; pUser_Standard_Requests
000014  6800              LDR      r0,[r0,#0]            ;64
000016  4780              BLX      r0                    ;64
000018  6820              LDR      r0,[r4,#0]            ;65  ; pInformation
00001a  300a              ADDS     r0,r0,#0xa            ;65
00001c  bd10              POP      {r4,pc}
;;;67     
                          ENDP

00001e  0000              DCW      0x0000
                  |L12.32|
                          DCD      pInformation
                  |L12.36|
                          DCD      pUser_Standard_Requests

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

                  Standard_GetDescriptorData PROC
;;;404    *******************************************************************************/
;;;405    u8 *Standard_GetDescriptorData(u16 Length, ONE_DESCRIPTOR *pDesc)
000000  4a06              LDR      r2,|L13.28|
;;;406    {
;;;407      u32  wOffset;
;;;408    
;;;409      wOffset = pInformation->Ctrl_Info.Usb_wOffset;
;;;410      if (Length == 0)
000002  2800              CMP      r0,#0
000004  6812              LDR      r2,[r2,#0]            ;409  ; pInformation
000006  8a50              LDRH     r0,[r2,#0x12]         ;409
000008  d104              BNE      |L13.20|
;;;411      {
;;;412        pInformation->Ctrl_Info.Usb_wLength = pDesc->Descriptor_Size - wOffset;
00000a  8889              LDRH     r1,[r1,#4]
00000c  1a08              SUBS     r0,r1,r0
00000e  8210              STRH     r0,[r2,#0x10]
;;;413        return 0;
000010  2000              MOVS     r0,#0
;;;414      }
;;;415    
;;;416      return pDesc->Descriptor + wOffset;
;;;417    }
000012  4770              BX       lr
                  |L13.20|
000014  6809              LDR      r1,[r1,#0]            ;416
000016  4408              ADD      r0,r0,r1              ;416
000018  4770              BX       lr
;;;418    
                          ENDP

00001a  0000              DCW      0x0000
                  |L13.28|
                          DCD      pInformation

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

                  Standard_GetInterface PROC
;;;101    *******************************************************************************/
;;;102    u8 *Standard_GetInterface(u16 Length)
000000  b510              PUSH     {r4,lr}
;;;103    {
;;;104      if (Length == 0)
;;;105      {
;;;106        pInformation->Ctrl_Info.Usb_wLength =
000002  4c07              LDR      r4,|L14.32|
000004  b920              CBNZ     r0,|L14.16|
000006  6821              LDR      r1,[r4,#0]  ; pInformation
000008  2001              MOVS     r0,#1
00000a  8208              STRH     r0,[r1,#0x10]
;;;107          sizeof(pInformation->Current_AlternateSetting);
;;;108        return 0;
00000c  2000              MOVS     r0,#0
;;;109      }
;;;110      pUser_Standard_Requests->User_GetInterface();
;;;111      return (u8 *)&pInformation->Current_AlternateSetting;
;;;112    }
00000e  bd10              POP      {r4,pc}
                  |L14.16|
000010  4804              LDR      r0,|L14.36|
000012  6800              LDR      r0,[r0,#0]            ;110  ; pUser_Standard_Requests
000014  6880              LDR      r0,[r0,#8]            ;110
000016  4780              BLX      r0                    ;110
000018  6820              LDR      r0,[r4,#0]            ;111  ; pInformation
00001a  300c              ADDS     r0,r0,#0xc            ;111
00001c  bd10              POP      {r4,pc}
;;;113    
                          ENDP

00001e  0000              DCW      0x0000
                  |L14.32|
                          DCD      pInformation
                  |L14.36|
                          DCD      pUser_Standard_Requests

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

                  Standard_GetStatus PROC
;;;157    *******************************************************************************/
;;;158    u8 *Standard_GetStatus(u16 Length)
000000  b510              PUSH     {r4,lr}
;;;159    {
;;;160      if (Length == 0)
;;;161      {
;;;162        pInformation->Ctrl_Info.Usb_wLength = 2;
000002  491f              LDR      r1,|L15.128|
000004  6809              LDR      r1,[r1,#0]
000006  b910              CBNZ     r0,|L15.14|
000008  2002              MOVS     r0,#2
00000a  8208              STRH     r0,[r1,#0x10]
;;;163        return 0;
00000c  e035              B        |L15.122|
                  |L15.14|
;;;164      }
;;;165    
;;;166      StatusInfo.w = 0;
00000e  481d              LDR      r0,|L15.132|
000010  2200              MOVS     r2,#0
000012  8002              STRH     r2,[r0,#0]
;;;167      /* Reset Status Information */
;;;168    
;;;169      if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
000014  780a              LDRB     r2,[r1,#0]
000016  0653              LSLS     r3,r2,#25
000018  d10c              BNE      |L15.52|
;;;170      {
;;;171        /*Get Device Status */
;;;172        u8 Feature = pInformation->Current_Feature;
00001a  7a49              LDRB     r1,[r1,#9]
;;;173    
;;;174        /* Remote Wakeup enabled */
;;;175        if (ValBit(Feature, 5))
00001c  068a              LSLS     r2,r1,#26
00001e  d503              BPL      |L15.40|
;;;176        {
;;;177          SetBit(StatusInfo0, 1);
000020  7802              LDRB     r2,[r0,#0]  ; StatusInfo
000022  f0420202          ORR      r2,r2,#2
000026  7002              STRB     r2,[r0,#0]
                  |L15.40|
;;;178        }
;;;179    
;;;180        /* Self-powered */
;;;181        if (ValBit(Feature, 6))
000028  0649              LSLS     r1,r1,#25
00002a  d418              BMI      |L15.94|
;;;182        {
;;;183          SetBit(StatusInfo0, 0);
;;;184        }
;;;185        else /* Bus-powered */
;;;186        {
;;;187          ClrBit(StatusInfo0, 0);
00002c  7801              LDRB     r1,[r0,#0]  ; StatusInfo
00002e  f00101fe          AND      r1,r1,#0xfe
000032  e017              B        |L15.100|
                  |L15.52|
;;;188        }
;;;189      }
;;;190      /*Interface Status*/
;;;191      else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
000034  f002027f          AND      r2,r2,#0x7f
000038  2a01              CMP      r2,#1
00003a  d101              BNE      |L15.64|
                  |L15.60|
;;;192      {
;;;193        return (u8 *)&StatusInfo;
00003c  4811              LDR      r0,|L15.132|
;;;194      }
;;;195      /*Get EndPoint Status*/
;;;196      else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
;;;197      {
;;;198        u8 Related_Endpoint;
;;;199        u8 wIndex0 = pInformation->USBwIndex0;
;;;200    
;;;201        Related_Endpoint = (wIndex0 & 0x0f);
;;;202        if (ValBit(wIndex0, 7))
;;;203        {
;;;204          /* IN endpoint */
;;;205          if (_GetTxStallStatus(Related_Endpoint))
;;;206          {
;;;207            SetBit(StatusInfo0, 0); /* IN Endpoint stalled */
;;;208          }
;;;209        }
;;;210        else
;;;211        {
;;;212          /* OUT endpoint */
;;;213          if (_GetRxStallStatus(Related_Endpoint))
;;;214          {
;;;215            SetBit(StatusInfo0, 0); /* OUT Endpoint stalled */
;;;216          }
;;;217        }
;;;218    
;;;219      }
;;;220      else
;;;221      {
;;;222        return NULL;
;;;223      }
;;;224      pUser_Standard_Requests->User_GetStatus();
;;;225      return (u8 *)&StatusInfo;
;;;226    }
00003e  bd10              POP      {r4,pc}
                  |L15.64|
000040  2a02              CMP      r2,#2                 ;196
000042  d11a              BNE      |L15.122|
000044  794a              LDRB     r2,[r1,#5]            ;199
000046  f002010f          AND      r1,r2,#0xf            ;201
00004a  0613              LSLS     r3,r2,#24             ;202
00004c  4a0e              LDR      r2,|L15.136|
00004e  eb020181          ADD      r1,r2,r1,LSL #2       ;205
000052  f8d11c00          LDR      r1,[r1,#0xc00]        ;205
000056  d507              BPL      |L15.104|
000058  f3c11101          UBFX     r1,r1,#4,#2           ;205
00005c  e006              B        |L15.108|
                  |L15.94|
00005e  7801              LDRB     r1,[r0,#0]            ;207  ; StatusInfo
000060  f0410101          ORR      r1,r1,#1              ;207
                  |L15.100|
000064  7001              STRB     r1,[r0,#0]            ;207
000066  e003              B        |L15.112|
                  |L15.104|
000068  f3c13101          UBFX     r1,r1,#12,#2          ;213
                  |L15.108|
00006c  2901              CMP      r1,#1                 ;205
00006e  d0f6              BEQ      |L15.94|
                  |L15.112|
000070  4806              LDR      r0,|L15.140|
000072  6800              LDR      r0,[r0,#0]            ;224  ; pUser_Standard_Requests
000074  6900              LDR      r0,[r0,#0x10]         ;224
000076  4780              BLX      r0                    ;224
000078  e7e0              B        |L15.60|
                  |L15.122|
00007a  2000              MOVS     r0,#0                 ;222
00007c  bd10              POP      {r4,pc}
;;;227    
                          ENDP

00007e  0000              DCW      0x0000
                  |L15.128|
                          DCD      pInformation
                  |L15.132|
                          DCD      ||.data||
                  |L15.136|
                          DCD      0x40005000
                  |L15.140|
                          DCD      pUser_Standard_Requests

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

                  Standard_SetConfiguration PROC
;;;76     *******************************************************************************/
;;;77     RESULT Standard_SetConfiguration(void)
000000  b510              PUSH     {r4,lr}
;;;78     {
;;;79     
;;;80       if ((pInformation->USBwValue0 <=
000002  480a              LDR      r0,|L16.44|
000004  490a              LDR      r1,|L16.48|
000006  6800              LDR      r0,[r0,#0]  ; pInformation
000008  784a              LDRB     r2,[r1,#1]  ; Device_Table
00000a  78c1              LDRB     r1,[r0,#3]
00000c  4291              CMP      r1,r2
00000e  d80a              BHI      |L16.38|
;;;81           Device_Table.Total_Configuration) && (pInformation->USBwValue1 == 0)
000010  7882              LDRB     r2,[r0,#2]
000012  b942              CBNZ     r2,|L16.38|
;;;82           && (pInformation->USBwIndex == 0)) /*call Back usb spec 2.0*/
000014  8882              LDRH     r2,[r0,#4]
000016  b932              CBNZ     r2,|L16.38|
;;;83       {
;;;84         pInformation->Current_Configuration = pInformation->USBwValue0;
000018  7281              STRB     r1,[r0,#0xa]
;;;85         pUser_Standard_Requests->User_SetConfiguration();
00001a  4806              LDR      r0,|L16.52|
00001c  6800              LDR      r0,[r0,#0]  ; pUser_Standard_Requests
00001e  6840              LDR      r0,[r0,#4]
000020  4780              BLX      r0
;;;86         return USB_SUCCESS;
000022  2000              MOVS     r0,#0
;;;87       }
;;;88       else
;;;89       {
;;;90         return USB_UNSUPPORT;
;;;91       }
;;;92     }
000024  bd10              POP      {r4,pc}
                  |L16.38|
000026  2002              MOVS     r0,#2                 ;90
000028  bd10              POP      {r4,pc}
;;;93     
                          ENDP

00002a  0000              DCW      0x0000
                  |L16.44|
                          DCD      pInformation
                  |L16.48|
                          DCD      Device_Table
                  |L16.52|
                          DCD      pUser_Standard_Requests

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

                  Standard_SetDeviceFeature PROC
;;;378    *******************************************************************************/
;;;379    RESULT Standard_SetDeviceFeature(void)
000000  b510              PUSH     {r4,lr}
;;;380    {
;;;381      SetBit(pInformation->Current_Feature, 5);
000002  4806              LDR      r0,|L17.28|
000004  6800              LDR      r0,[r0,#0]  ; pInformation
000006  7a41              LDRB     r1,[r0,#9]
000008  f0410120          ORR      r1,r1,#0x20
00000c  7241              STRB     r1,[r0,#9]
;;;382      pUser_Standard_Requests->User_SetDeviceFeature();
00000e  4804              LDR      r0,|L17.32|
000010  6800              LDR      r0,[r0,#0]  ; pUser_Standard_Requests
000012  69c0              LDR      r0,[r0,#0x1c]
000014  4780              BLX      r0
;;;383      return USB_SUCCESS;
000016  2000              MOVS     r0,#0
;;;384    }
000018  bd10              POP      {r4,pc}
;;;385    
                          ENDP

00001a  0000              DCW      0x0000
                  |L17.28|
                          DCD      pInformation
                  |L17.32|
                          DCD      pUser_Standard_Requests

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

                  Standard_SetEndPointFeature PROC
;;;324    *******************************************************************************/
;;;325    RESULT Standard_SetEndPointFeature(void)
000000  b570              PUSH     {r4-r6,lr}
;;;326    {
;;;327      u32    wIndex0;
;;;328      u32    Related_Endpoint;
;;;329      u32    rEP;
;;;330      u32   Status;
;;;331    
;;;332      wIndex0 = pInformation->USBwIndex0;
000002  481c              LDR      r0,|L18.116|
000004  6802              LDR      r2,[r0,#0]  ; pInformation
;;;333      rEP = wIndex0 & ~0x80;
;;;334      Related_Endpoint = ENDP0 + rEP;
;;;335    
;;;336      if (ValBit(pInformation->USBwIndex0, 7))
;;;337      {
;;;338        /* get Status of endpoint & stall the request if the related_ENdpoint
;;;339        is Disabled*/
;;;340        Status = _GetEPTxStatus(Related_Endpoint);
000006  481c              LDR      r0,|L18.120|
000008  7951              LDRB     r1,[r2,#5]            ;332
00000a  f0210580          BIC      r5,r1,#0x80           ;333
00000e  060b              LSLS     r3,r1,#24             ;336
000010  eb000085          ADD      r0,r0,r5,LSL #2
000014  f8d03c00          LDR      r3,[r0,#0xc00]
000018  f0210480          BIC      r4,r1,#0x80           ;333
00001c  d503              BPL      |L18.38|
00001e  f3c31301          UBFX     r3,r3,#4,#2
000022  011b              LSLS     r3,r3,#4
000024  e002              B        |L18.44|
                  |L18.38|
;;;341      }
;;;342      else
;;;343      {
;;;344        Status = _GetEPRxStatus(Related_Endpoint);
000026  f3c33301          UBFX     r3,r3,#12,#2
00002a  031b              LSLS     r3,r3,#12
                  |L18.44|
;;;345      }
;;;346    
;;;347      if (Related_Endpoint >= Device_Table.Total_Endpoint
00002c  4d13              LDR      r5,|L18.124|
00002e  782d              LDRB     r5,[r5,#0]  ; Device_Table
000030  42a5              CMP      r5,r4
000032  d904              BLS      |L18.62|
;;;348          || pInformation->USBwValue != 0 || Status == 0
000034  8854              LDRH     r4,[r2,#2]
000036  b914              CBNZ     r4,|L18.62|
000038  b10b              CBZ      r3,|L18.62|
;;;349          || pInformation->Current_Configuration == 0)
00003a  7a92              LDRB     r2,[r2,#0xa]
00003c  b90a              CBNZ     r2,|L18.66|
                  |L18.62|
;;;350      {
;;;351        return USB_UNSUPPORT;
00003e  2002              MOVS     r0,#2
;;;352      }
;;;353      else
;;;354      {
;;;355        if (wIndex0 & 0x80)
;;;356        {
;;;357          /* IN endpoint */
;;;358          _SetEPTxStatus(Related_Endpoint, EP_TX_STALL);
;;;359        }
;;;360    
;;;361        else
;;;362        {
;;;363          /* OUT endpoint */
;;;364          _SetEPRxStatus(Related_Endpoint, EP_RX_STALL);
;;;365        }
;;;366      }
;;;367      pUser_Standard_Requests->User_SetEndPointFeature();
;;;368      return USB_SUCCESS;
;;;369    }
000040  bd70              POP      {r4-r6,pc}
                  |L18.66|
000042  0609              LSLS     r1,r1,#24             ;355
000044  f8d01c00          LDR      r1,[r0,#0xc00]        ;358
000048  d506              BPL      |L18.88|
00004a  f64872bf          MOV      r2,#0x8fbf            ;358
00004e  b289              UXTH     r1,r1                 ;358
000050  4011              ANDS     r1,r1,r2              ;358
000052  f0810110          EOR      r1,r1,#0x10           ;358
000056  e005              B        |L18.100|
                  |L18.88|
000058  f64b728f          MOV      r2,#0xbf8f            ;364
00005c  b289              UXTH     r1,r1                 ;364
00005e  4011              ANDS     r1,r1,r2              ;364
000060  f4815180          EOR      r1,r1,#0x1000         ;364
                  |L18.100|
000064  f8c01c00          STR      r1,[r0,#0xc00]        ;358
000068  4805              LDR      r0,|L18.128|
00006a  6800              LDR      r0,[r0,#0]            ;367  ; pUser_Standard_Requests
00006c  6980              LDR      r0,[r0,#0x18]         ;367
00006e  4780              BLX      r0                    ;367
000070  2000              MOVS     r0,#0                 ;368
000072  bd70              POP      {r4-r6,pc}
;;;370    
                          ENDP

                  |L18.116|
                          DCD      pInformation
                  |L18.120|
                          DCD      0x40005000
                  |L18.124|
                          DCD      Device_Table
                  |L18.128|
                          DCD      pUser_Standard_Requests

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

                  Standard_SetInterface PROC
;;;122    *******************************************************************************/
;;;123    RESULT Standard_SetInterface(void)
000000  b510              PUSH     {r4,lr}
;;;124    {
;;;125      RESULT Re;
;;;126      /*Test if the specified Interface and Alternate Setting are supported by
;;;127        the application Firmware*/
;;;128      Re = (*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, pInformation->USBwValue0);
000002  4c0e              LDR      r4,|L19.60|
000004  4a0e              LDR      r2,|L19.64|
000006  6820              LDR      r0,[r4,#0]  ; pInformation
000008  6812              LDR      r2,[r2,#0]  ; pProperty
00000a  78c1              LDRB     r1,[r0,#3]
00000c  6992              LDR      r2,[r2,#0x18]
00000e  7940              LDRB     r0,[r0,#5]
000010  4790              BLX      r2
;;;129    
;;;130      if (pInformation->Current_Configuration != 0)
000012  6821              LDR      r1,[r4,#0]  ; pInformation
000014  7a8a              LDRB     r2,[r1,#0xa]
000016  b17a              CBZ      r2,|L19.56|
;;;131      {
;;;132        if ((Re != USB_SUCCESS) || (pInformation->USBwIndex1 != 0)
000018  b970              CBNZ     r0,|L19.56|
00001a  7908              LDRB     r0,[r1,#4]
00001c  b960              CBNZ     r0,|L19.56|
;;;133            || (pInformation->USBwValue1 != 0))
00001e  7888              LDRB     r0,[r1,#2]
000020  b950              CBNZ     r0,|L19.56|
;;;134        {
;;;135          return  USB_UNSUPPORT;
;;;136        }
;;;137        else if (Re == USB_SUCCESS)
;;;138        {
;;;139          pUser_Standard_Requests->User_SetInterface();
000022  4808              LDR      r0,|L19.68|
000024  6800              LDR      r0,[r0,#0]  ; pUser_Standard_Requests
000026  68c0              LDR      r0,[r0,#0xc]
000028  4780              BLX      r0
;;;140          pInformation->Current_Interface = pInformation->USBwIndex0;
00002a  6820              LDR      r0,[r4,#0]  ; pInformation
00002c  7941              LDRB     r1,[r0,#5]
00002e  72c1              STRB     r1,[r0,#0xb]
;;;141          pInformation->Current_AlternateSetting = pInformation->USBwValue0;
000030  78c1              LDRB     r1,[r0,#3]
000032  7301              STRB     r1,[r0,#0xc]
;;;142          return USB_SUCCESS;
000034  2000              MOVS     r0,#0
;;;143        }
;;;144    
;;;145      }
;;;146    
;;;147      return USB_UNSUPPORT;
;;;148    }
000036  bd10              POP      {r4,pc}
                  |L19.56|
000038  2002              MOVS     r0,#2                 ;147
00003a  bd10              POP      {r4,pc}
;;;149    
                          ENDP

                  |L19.60|
                          DCD      pInformation
                  |L19.64|
                          DCD      pProperty
                  |L19.68|
                          DCD      pUser_Standard_Requests

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

                  StatusInfo
000000  0000              DCB      0x00,0x00
