diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c index 63fce0dcb6e35e7f746e1b61f248da5d62379a1a..8ea5e7201d8d7b53b912244589bf748aeee67fb7 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c @@ -260,12 +260,7 @@ void ProcessMouseReport(uint8_t* MouseReport) if (!(FoundData)) continue; - int16_t DeltaMovement; - - if (ReportItem->Attributes.BitSize > 8) - DeltaMovement = (int16_t)ReportItem->Value; - else - DeltaMovement = (int8_t)ReportItem->Value; + int16_t DeltaMovement = (int16_t)(ReportItem->Value << (16 - ReportItem->Attributes.BitSize)); /* Determine if the report is for the X or Y delta movement */ if (ReportItem->Attributes.Usage.Usage == USAGE_X) diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c index 18519a018e5d3bc26fb333b38e9220ba6ccc93fe..cee602a338e109d6f18c13a419f3fffd5ec27cdc 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c @@ -113,6 +113,8 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID break; case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID): CurrStateTable->ReportID = ReportItemData; + BitOffsetIn = 0; + BitOffsetOut = 0; break; case (TYPE_LOCAL | TAG_LOCAL_USAGE): if (UsageStackSize == HID_USAGE_STACK_DEPTH) diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 2aaef12d4f6522bde350cd8ceda170dfb562384b..1a09e8b8ead602965a26de4d57f25bcc9ea0c410 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -73,6 +73,8 @@ * - Fixed Mouse/Keyboard demos not performing the correct arithmetic on the Idle period at the right times (thanks to Brian Dickman) * - Fixed GenericHID failing HID class tests due to incorrect Logical Minimum and Logical Maximum values (thanks to S�ren Greiner) * - Fixed incorrect PIPE_EPNUM_MASK mask causing pipe failures on devices with endpoint addresses of 8 and above (thanks to John Andrews) + * - Fixed report data alignment issues in the MouseHostWithParser demo when X and Y movement data size is not a multiple of 8 bits + * - Fixed HID Report Descriptor Parser not correctly resetting internal states when a REPORT ID element is encountered * * * \section Sec_ChangeLog090605 Version 090605