diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-07-28 15:14:54 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-07-28 15:14:54 +0000 |
| commit | da4f6bab4a8493f688aed6be4263b1d83880f58e (patch) | |
| tree | 8367df3c332b382b5a2122dccabdbaf2d80a1cc1 /Demos | |
| parent | fcb449eb7861f2268515eff6640c07559f689c73 (diff) | |
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.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@695 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos')
| -rw-r--r-- | Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c index 63fce0dc..8ea5e720 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)
|
