Fixed USB_RemoteWakeupEnabled flag never being set (the REMOTE WAKEUP Set Feature...
[pub/USBasp.git] / Demos / Device / KeyboardMouse / KeyboardMouse.c
index a85a378..dc039ee 100644 (file)
@@ -144,6 +144,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                case REQ_GetReport:\r
                        if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
+                               Endpoint_ClearSETUP();\r
+       \r
                                /* Determine if it is the mouse or the keyboard data that is being requested */\r
                                if (!(USB_ControlRequest.wIndex))\r
                                {\r
@@ -156,8 +158,6 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                        ReportSize = sizeof(MouseReportData);\r
                                }\r
 \r
-                               Endpoint_ClearSETUP();\r
-       \r
                                /* Write the report data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(ReportData, ReportSize);\r
 \r