aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers/USB')
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDParser.c4
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDParser.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c
index 3ef9c7812..6c81ae8e5 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDParser.c
+++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c
@@ -340,8 +340,10 @@ uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData, const uint8_t
{
for (uint8_t i = 0; i < HID_MAX_REPORT_IDS; i++)
{
+ uint16_t ReportSizeBits = ParserData->ReportIDSizes[i].ReportSizeBits[ReportType];
+
if (ParserData->ReportIDSizes[i].ReportID == ReportID)
- return ParserData->ReportIDSizes[i].ReportSizeBits[ReportType];
+ return ((ReportSizeBits >> 3) + ((ReportSizeBits & 0x07) ? 1 : 0));
}
return 0;
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.h b/LUFA/Drivers/USB/Class/Host/HIDParser.h
index 53601ec61..b7225f332 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDParser.h
+++ b/LUFA/Drivers/USB/Class/Host/HIDParser.h
@@ -215,7 +215,7 @@
typedef struct
{
uint8_t ReportID; /** Report ID of the report within the HID interface */
- uint8_t ReportSizeBits[3]; /** Total number of bits in each report type for the given Report ID,
+ uint16_t ReportSizeBits[3]; /** Total number of bits in each report type for the given Report ID,
* indexed by the \ref HID_ReportItemTypes_t enum
*/
} HID_ReportSizeInfo_t;