aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Device/HID.c
diff options
context:
space:
mode:
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 e75b022f5..412673824 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;