Fixed USB_RemoteWakeupEnabled flag never being set (the REMOTE WAKEUP Set Feature...
[pub/USBasp.git] / Demos / Device / CDC / CDC.c
index 28bce1e..59aa98c 100644 (file)
@@ -193,14 +193,14 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                case REQ_SetControlLineState:\r
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                case REQ_SetControlLineState:\r
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\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
                                /* 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
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
                                Endpoint_ClearIN();\r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
                                Endpoint_ClearIN();\r