X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/50722269b6e7b1ce8601ee2fc8d30100e5639d34..83288efc7d1b673d30edee6ce732d1de8c505da3:/common/usb.c diff --git a/common/usb.c b/common/usb.c index 50a9fc69..bef4d7e0 100644 --- a/common/usb.c +++ b/common/usb.c @@ -259,6 +259,19 @@ static void UsbSendZeroLength(void) ; } +static void UsbSendStall(void) +{ + UDP_ENDPOINT_CSR(0) |= UDP_CSR_FORCE_STALL; + + while(!(UDP_ENDPOINT_CSR(0) & UDP_CSR_STALL_SENT)) + ; + + UDP_ENDPOINT_CSR(0) &= ~UDP_CSR_STALL_SENT; + + while(UDP_ENDPOINT_CSR(0) & UDP_CSR_STALL_SENT) + ; +} + static void HandleRxdSetupData(void) { int i; @@ -346,6 +359,8 @@ static void HandleRxdSetupData(void) case USB_REQUEST_CLEAR_FEATURE: case USB_REQUEST_SET_FEATURE: + UsbSendStall(); + break; case USB_REQUEST_SET_DESCRIPTOR: case USB_REQUEST_SYNC_FRAME: default: