Partial Commit: Remove now empty Projects\Incomplete directory and add the new AVRISP...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / HID.c
index 40f7d2f..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