|
|
|
|
|
|
|
|
if (USB1_ENDPTPRIME & epmask) goto end; |
|
|
if (USB1_ENDPTPRIME & epmask) goto end; |
|
|
//digitalWriteFast(2, HIGH); |
|
|
//digitalWriteFast(2, HIGH); |
|
|
//ret |= 0x01; |
|
|
//ret |= 0x01; |
|
|
uint32_t status; |
|
|
|
|
|
|
|
|
uint32_t status, cyccnt=ARM_DWT_CYCCNT; |
|
|
do { |
|
|
do { |
|
|
USB1_USBCMD |= USB_USBCMD_ATDTW; |
|
|
USB1_USBCMD |= USB_USBCMD_ATDTW; |
|
|
status = USB1_ENDPTSTATUS; |
|
|
status = USB1_ENDPTSTATUS; |
|
|
} while (!(USB1_USBCMD & USB_USBCMD_ATDTW)); |
|
|
|
|
|
|
|
|
} while (!(USB1_USBCMD & USB_USBCMD_ATDTW) && (ARM_DWT_CYCCNT - cyccnt < 2400)); |
|
|
//USB1_USBCMD &= ~USB_USBCMD_ATDTW; |
|
|
//USB1_USBCMD &= ~USB_USBCMD_ATDTW; |
|
|
if (status & epmask) goto end; |
|
|
if (status & epmask) goto end; |
|
|
//ret |= 0x02; |
|
|
//ret |= 0x02; |