]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Send Stall in response to USB SET FEATURE or CLEAR FEATURE requests. Speeds up device...
authorhenryk@ploetzli.ch <henryk@ploetzli.ch@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Fri, 28 Aug 2009 00:44:09 +0000 (00:44 +0000)
committerhenryk@ploetzli.ch <henryk@ploetzli.ch@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Fri, 28 Aug 2009 00:44:09 +0000 (00:44 +0000)
common/usb.c

index 50a9fc6936524810b5d254c7eb881f430086abf2..bef4d7e057eb3fc6769892ebe89e3fea1a1f3122 100644 (file)
@@ -259,6 +259,19 @@ static void UsbSendZeroLength(void)
                ;\r
 }\r
 \r
+static void UsbSendStall(void)\r
+{\r
+       UDP_ENDPOINT_CSR(0) |= UDP_CSR_FORCE_STALL;\r
+\r
+       while(!(UDP_ENDPOINT_CSR(0) & UDP_CSR_STALL_SENT))\r
+               ;\r
+\r
+       UDP_ENDPOINT_CSR(0) &= ~UDP_CSR_STALL_SENT;\r
+\r
+       while(UDP_ENDPOINT_CSR(0) & UDP_CSR_STALL_SENT)\r
+               ;\r
+}\r
+\r
 static void HandleRxdSetupData(void)\r
 {\r
        int i;\r
@@ -346,6 +359,8 @@ static void HandleRxdSetupData(void)
 \r
                case USB_REQUEST_CLEAR_FEATURE:\r
                case USB_REQUEST_SET_FEATURE:\r
+                       UsbSendStall();\r
+                       break;\r
                case USB_REQUEST_SET_DESCRIPTOR:\r
                case USB_REQUEST_SYNC_FRAME:\r
                default:\r
Impressum, Datenschutz