X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f555ad7ced743a19eb1eefaf5eaf536fcbe58d80..0019fbd1294ccc9ecb0ac4ddb5d8c71efcf9597f:/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 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;