Partial Commit: Remove now empty Projects\Incomplete directory and add the new AVRISP...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / HID.c
index fbb45ac..0cbd50a 100644 (file)
 \r
 #include "HID.h"\r
 \r
-void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
+void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
 {\r
        if (!(Endpoint_IsSETUPReceived()))\r
          return;\r
          \r
-       if ((USB_ControlRequest.wIndex   != HIDInterfaceInfo->Config.InterfaceNumber) &&\r
-           (USB_ControlRequest.bRequest != REQ_SetIdle))\r
-       {\r
-               return;\r
-       }\r
+       if (USB_ControlRequest.wIndex != HIDInterfaceInfo->Config.InterfaceNumber)\r
+         return;\r
 \r
        switch (USB_ControlRequest.bRequest)\r
        {\r
@@ -106,15 +103,11 @@ void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* const HIDInterf
                case REQ_SetIdle:\r
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               if ((USB_ControlRequest.wIndex         == HIDInterfaceInfo->Config.InterfaceNumber) ||\r
-                                   (USB_ControlRequest.wValue & 0xFF) == 0)\r
-                               {\r
-                                       Endpoint_ClearSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                        \r
-                                       HIDInterfaceInfo->State.IdleCount = ((USB_ControlRequest.wValue & 0xFF00) >> 6);\r
+                               HIDInterfaceInfo->State.IdleCount = ((USB_ControlRequest.wValue & 0xFF00) >> 6);\r
                                        \r
-                                       Endpoint_ClearStatusStage();\r
-                               }\r
+                               Endpoint_ClearStatusStage();\r
                        }\r
                        \r
                        break;\r
@@ -136,8 +129,8 @@ void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* const HIDInterf
 bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
 {\r
        memset(&HIDInterfaceInfo->State, 0x00, sizeof(HIDInterfaceInfo->State));\r
-       HIDInterfaceInfo->State.IdleCount = 500;\r
        HIDInterfaceInfo->State.UsingReportProtocol = true;\r
+       HIDInterfaceInfo->State.IdleCount = 500;\r
 \r
        if (!(Endpoint_ConfigureEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber, EP_TYPE_INTERRUPT,\r
                                                                         ENDPOINT_DIR_IN, HIDInterfaceInfo->Config.ReportINEndpointSize, ENDPOINT_BANK_SINGLE)))\r