X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/6f4cc344ab47b720651e5bbf7674951c32e210b1..cfe054474ffafddcbba0f6d3f46d3f02473fac96:/LUFA/Drivers/USB/Class/Device/HID.c diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c index 40f7d2f49..0cbd50afc 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.c +++ b/LUFA/Drivers/USB/Class/Device/HID.c @@ -33,16 +33,13 @@ #include "HID.h" -void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) +void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) { if (!(Endpoint_IsSETUPReceived())) return; - if ((USB_ControlRequest.wIndex != HIDInterfaceInfo->Config.InterfaceNumber) && - (USB_ControlRequest.bRequest != REQ_SetIdle)) - { - return; - } + if (USB_ControlRequest.wIndex != HIDInterfaceInfo->Config.InterfaceNumber) + return; switch (USB_ControlRequest.bRequest) { @@ -106,15 +103,11 @@ void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* const HIDInterf case REQ_SetIdle: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { - if ((USB_ControlRequest.wIndex == HIDInterfaceInfo->Config.InterfaceNumber) || - (USB_ControlRequest.wValue & 0xFF) == 0) - { - Endpoint_ClearSETUP(); + Endpoint_ClearSETUP(); - HIDInterfaceInfo->State.IdleCount = ((USB_ControlRequest.wValue & 0xFF00) >> 6); + HIDInterfaceInfo->State.IdleCount = ((USB_ControlRequest.wValue & 0xFF00) >> 6); - Endpoint_ClearStatusStage(); - } + Endpoint_ClearStatusStage(); } break;