X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d49cc0f7830319e701294e19937fae4de26ae8e2..19ecd04f37f68c0674f1194aa8d8a4fc94d6168b:/LUFA/Drivers/USB/Class/Host/HID.c diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c index 1e1dbcff6..5d5d2ef98 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.c +++ b/LUFA/Drivers/USB/Class/Host/HID.c @@ -159,7 +159,7 @@ uint8_t HID_Host_ReceiveReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceI { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bRequest = REQ_SetReport, - .wValue = (REPORT_ITEM_TYPE_In << 8) | ReportID, + .wValue = ((REPORT_ITEM_TYPE_In + 1) << 8) | ReportID, .wIndex = HIDInterfaceInfo->State.InterfaceNumber, .wLength = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In), }; @@ -181,6 +181,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, Pipe_Unfreeze(); uint16_t ReportSize; + uint8_t* BufferPos = Buffer; #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY) if (!(HIDInterfaceInfo->State.UsingBootProtocol)) @@ -190,7 +191,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, if (HIDInterfaceInfo->Config.HIDParserData->UsingReportIDs) { ReportID = Pipe_Read_Byte(); - *((uint8_t*)Buffer++) = ReportID; + *(BufferPos++) = ReportID; } ReportSize = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In); @@ -201,7 +202,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, ReportSize = Pipe_BytesInPipe(); } - if ((ErrorCode = Pipe_Read_Stream_LE(Buffer, ReportSize, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = Pipe_Read_Stream_LE(BufferPos, ReportSize, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) return ErrorCode; Pipe_ClearIN(); @@ -246,7 +247,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bRequest = REQ_SetReport, #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY) - .wValue = (REPORT_ITEM_TYPE_Out << 8) | ReportID, + .wValue = ((REPORT_ITEM_TYPE_Out + 1) << 8) | ReportID, #else .wValue = 0, #endif