Bluetooth demo can now create and maintain logical channels - need to determine why...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / HIDParser.c
index 8ffde6c..386c3b9 100644 (file)
@@ -1,13 +1,13 @@
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
@@ -28,6 +28,7 @@
   this software.\r
 */\r
 \r
+#define  __INCLUDE_FROM_USB_DRIVER\r
 #include "../../HighLevel/USBMode.h"\r
 #if defined(USB_CAN_BE_HOST)\r
 \r
@@ -340,8 +341,10 @@ uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData, const uint8_t
 {\r
        for (uint8_t i = 0; i < HID_MAX_REPORT_IDS; i++)\r
        {\r
+               uint16_t ReportSizeBits = ParserData->ReportIDSizes[i].ReportSizeBits[ReportType];\r
+       \r
                if (ParserData->ReportIDSizes[i].ReportID == ReportID)\r
-                 return ParserData->ReportIDSizes[i].ReportSizeBits[ReportType];\r
+                 return ((ReportSizeBits >> 3) + ((ReportSizeBits & 0x07) ? 1 : 0));\r
        }\r
 \r
        return 0;\r