aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/USB/Class/Device
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-01-26 21:33:07 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-01-26 21:33:07 +0000
commite4da29294db85b3108a0669d39db27e494d6eb3f (patch)
tree7524d3d7c881de32080cb0ed82fc4aa16d6f7755 /LUFA/Drivers/USB/Class/Device
parent25d506a5ac64f3c77cd6d028a7e52d64076bb309 (diff)
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. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1643 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device')
-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 e75b022f..41267382 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;