aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/USB/Class/Device/HID.c
diff options
context:
space:
mode:
authorDean Camera <[email protected]>2011-01-26 21:33:07 +0000
committerDean Camera <[email protected]>2011-01-26 21:33:07 +0000
commita852ea8e43d6df9642df3524a974073d2229fa4c (patch)
tree7524d3d7c881de32080cb0ed82fc4aa16d6f7755 /LUFA/Drivers/USB/Class/Device/HID.c
parent6c7ed7ecd6d4727e33ddb8c5e4321499a2b76151 (diff)
downloadqmk_firmware-a852ea8e43d6df9642df3524a974073d2229fa4c.tar.gz
qmk_firmware-a852ea8e43d6df9642df3524a974073d2229fa4c.zip
Added new KeyboardMouseMultiReport Device ClassDriver demo.
Fixed ReportID not being removed from the feature/out report data array in the HID class driver when Report IDs are used. Added new MAX() and MIN() convenience macros.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device/HID.c')
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c
index e75b022f57..4126738240 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.c
+++ b/LUFA/Drivers/USB/Class/Device/HID.c
@@ -59,8 +59,11 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, ReportType, ReportData, &ReportSize);
if (HIDInterfaceInfo->Config.PrevReportINBuffer != NULL)
- memcpy(HIDInterfaceInfo->Config.PrevReportINBuffer, ReportData, HIDInterfaceInfo->Config.PrevReportINBufferSize);
-
+ {
+ memcpy(HIDInterfaceInfo->Config.PrevReportINBuffer, ReportData,
+ HIDInterfaceInfo->Config.PrevReportINBufferSize);
+ }
+
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
Endpoint_ClearSETUP();
@@ -80,8 +83,9 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
Endpoint_ClearSETUP();
Endpoint_Read_Control_Stream_LE(ReportData, ReportSize);
Endpoint_ClearIN();
-
- CALLBACK_HID_Device_ProcessHIDReport(HIDInterfaceInfo, ReportID, ReportType, ReportData, ReportSize);
+
+ CALLBACK_HID_Device_ProcessHIDReport(HIDInterfaceInfo, ReportID, ReportType,
+ &ReportData[ReportID ? 1 : 0], ReportSize - (ReportID ? 1 : 0));
}
break;