aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Device
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-11 11:19:22 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-11 11:19:22 +0000
commitdf29aa37c05ff0251bd17f54c750bac56d7279b7 (patch)
tree257159f76c4d94e65771bb86abcbde6538e3c03c /LUFA/Drivers/USB/Class/Device
parenta7ade9f28dac6b42e2a85823ec80d5539c176667 (diff)
downloadlufa-df29aa37c05ff0251bd17f54c750bac56d7279b7.tar.gz
lufa-df29aa37c05ff0251bd17f54c750bac56d7279b7.tar.bz2
lufa-df29aa37c05ff0251bd17f54c750bac56d7279b7.zip
Added flag to the HID report parser to indicate if a device has multiple reports.
SetIdle requests to the HID device driver with a 0 idle period (send changes only) now only affect the requested HID interface within the device, not all HID interfaces. Apply correct fix to the HID report parser for PUSH items - current HID item attribute stack was being copied in the wrong direction. Fixed HID report parser not resetting the FEATURE item count when a REPORT ID item is encountered.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device')
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c
index 937214b94..0cbd50afc 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.c
+++ b/LUFA/Drivers/USB/Class/Device/HID.c
@@ -38,11 +38,8 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
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_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
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;