Fixed HID Parser's largest report size bit count not including the size of the last...
authorDean Camera <dean@fourwalledcubicle.com>
Sat, 17 Sep 2011 13:07:21 +0000 (13:07 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sat, 17 Sep 2011 13:07:21 +0000 (13:07 +0000)
Fixed HID host driver's largest HID report size count corrupt when the number of report bits exceeds 255.

LUFA/Drivers/USB/Class/Common/HIDParser.c
LUFA/Drivers/USB/Class/Host/HID.c
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/LUFAPoweredProjects.txt

index b601d86..903b039 100644 (file)
@@ -255,8 +255,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
 
                                        CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType] += CurrStateTable->Attributes.BitSize;
 
 
                                        CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType] += CurrStateTable->Attributes.BitSize;
 
-                                       if (ParserData->LargestReportSizeBits < NewReportItem.BitOffset)
-                                         ParserData->LargestReportSizeBits = NewReportItem.BitOffset;
+                                       ParserData->LargestReportSizeBits = MAX(ParserData->LargestReportSizeBits, CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType]);
 
                                        if (ParserData->TotalReportItems == HID_MAX_REPORTITEMS)
                                          return HID_PARSE_InsufficientReportItems;
 
                                        if (ParserData->TotalReportItems == HID_MAX_REPORTITEMS)
                                          return HID_PARSE_InsufficientReportItems;
index fdcd6ee..bfbe6cf 100644 (file)
@@ -421,7 +421,7 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
                return HID_ERROR_LOGICAL | ErrorCode;
        }
 
                return HID_ERROR_LOGICAL | ErrorCode;
        }
 
-       uint8_t LargestReportSizeBits = HIDInterfaceInfo->Config.HIDParserData->LargestReportSizeBits;
+       uint16_t LargestReportSizeBits = HIDInterfaceInfo->Config.HIDParserData->LargestReportSizeBits;
        HIDInterfaceInfo->State.LargestReportSize = (LargestReportSizeBits >> 3) + ((LargestReportSizeBits & 0x07) != 0);
 
        return 0;
        HIDInterfaceInfo->State.LargestReportSize = (LargestReportSizeBits >> 3) + ((LargestReportSizeBits & 0x07) != 0);
 
        return 0;
index 49e0955..526084b 100644 (file)
@@ -83,6 +83,8 @@
   *   - Fixed optimization error in the HID Parser item value USB_SetHIDReportItemInfo() and USB_GetHIDReportItemInfo() routines if the report item was
   *     \c NULL (which should be allowable according to the API)
   *   - Fixed HID Parser CALLBACK_HIDParser_FilterHIDReportItem() callback function not being passed a cacheable report item pointer
   *   - Fixed optimization error in the HID Parser item value USB_SetHIDReportItemInfo() and USB_GetHIDReportItemInfo() routines if the report item was
   *     \c NULL (which should be allowable according to the API)
   *   - Fixed HID Parser CALLBACK_HIDParser_FilterHIDReportItem() callback function not being passed a cacheable report item pointer
+  *   - Fixed HID Parser's largest report size bit count not including the size of the last parsed report item
+  *   - Fixed HID host driver's largest HID report size count corrupt when the number of report bits exceeds 255
   *  - Library Applications:
   *   - Fixed incorrect signature in the CDC and DFU class bootloaders for the ATMEGA8U2
   *   - Fixed KeyboardHost and KeyboardHostWithParser demos displaying incorrect values when numerical keys were pressed
   *  - Library Applications:
   *   - Fixed incorrect signature in the CDC and DFU class bootloaders for the ATMEGA8U2
   *   - Fixed KeyboardHost and KeyboardHostWithParser demos displaying incorrect values when numerical keys were pressed
index 8e1c9eb..a46e2c6 100644 (file)
@@ -39,6 +39,7 @@
  *  - Arcade Controller: http://fletchtronics.net/arcade-controller-made-petunia
  *  - AVR USB Modem, a 3G Wireless Modem host: http://code.google.com/p/avrusbmodem/
  *  - Bicycle POV: http://www.code.google.com/p/bicycleledpov/
  *  - Arcade Controller: http://fletchtronics.net/arcade-controller-made-petunia
  *  - AVR USB Modem, a 3G Wireless Modem host: http://code.google.com/p/avrusbmodem/
  *  - Bicycle POV: http://www.code.google.com/p/bicycleledpov/
+ *  - Bluetooth Explorerbot: http://code.google.com/p/bluetooth-explorerbot/
  *  - Bus Ninja, an AVR clone of the popular BusPirate project: http://blog.hodgepig.org/busninja/
  *  - CAMTRIG, a remote Camera Trigger device: http://code.astraw.com/projects/motmot/camtrig
  *  - CD Driver Emulator Dongle for ISO Files: http://cdemu.blogspot.com/
  *  - Bus Ninja, an AVR clone of the popular BusPirate project: http://blog.hodgepig.org/busninja/
  *  - CAMTRIG, a remote Camera Trigger device: http://code.astraw.com/projects/motmot/camtrig
  *  - CD Driver Emulator Dongle for ISO Files: http://cdemu.blogspot.com/