Added new USB_DeviceState variable to keep track of the current Device mode USB state.
[pub/lufa.git] / Bootloaders / TeensyHID / TeensyHID.c
index 12d5c0d..eed7097 100644 (file)
@@ -119,7 +119,7 @@ void EVENT_USB_UnhandledControlPacket(void)
                                \r
                                /* Wait until the command (report) has been sent by the host */\r
                                while (!(Endpoint_IsOUTReceived()));\r
-\r
+                       \r
                                /* Read in the write destination address */\r
                                uint16_t PageAddress = Endpoint_Read_Word_LE();\r
                                \r
@@ -158,9 +158,7 @@ void EVENT_USB_UnhandledControlPacket(void)
 \r
                                Endpoint_ClearOUT();\r
 \r
-                               /* Acknowledge status stage */\r
-                               while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearIN();\r
+                               Endpoint_ClearStatusStage();\r
                        }\r
                        \r
                        break;\r