Fixed USB_RemoteWakeupEnabled flag never being set (the REMOTE WAKEUP Set Feature...
[pub/USBasp.git] / Demos / Device / USBtoSerial / USBtoSerial.c
index dbf4b1b..ea8dcd5 100644 (file)
@@ -188,15 +188,15 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        break;\r
                case REQ_SetControlLineState:\r
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
-                       {\r
+                       {                               \r
+                               /* Acknowledge the SETUP packet, ready for data transfer */\r
+                               Endpoint_ClearSETUP();\r
+                               \r
                                /* NOTE: Here you can read in the line state mask from the host, to get the current state of the output handshake\r
                                         lines. The mask is read in from the wValue parameter in USB_ControlRequest, and can be masked against the\r
                                                 CONTROL_LINE_OUT_* masks to determine the RTS and DTR line states using the following code:\r
                                */\r
-                               \r
-                               /* Acknowledge the SETUP packet, ready for data transfer */\r
-                               Endpoint_ClearSETUP();\r
-                               \r
+\r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
                                Endpoint_ClearIN();\r