Fixed incorrect definition of HID_ALIGN_DATA() causing incorrect HID report item...
authorDean Camera <dean@fourwalledcubicle.com>
Wed, 24 Mar 2010 05:58:20 +0000 (05:58 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Wed, 24 Mar 2010 05:58:20 +0000 (05:58 +0000)
LUFA/Drivers/USB/Class/Host/HIDParser.h
LUFA/ManPages/ChangeLog.txt

index b969893..6b6549b 100644 (file)
                 *\r
                 *  \return Left-aligned data of the given report item's pre-retrived value for the given datatype\r
                 */\r
-               #define HID_ALIGN_DATA(reportitem, type) ((type)(reportitem->Value << (sizeof(type) - reportitem->Attributes.BitSize)))\r
+               #define HID_ALIGN_DATA(reportitem, type) ((type)(reportitem->Value << ((8 * sizeof(type)) - reportitem->Attributes.BitSize)))\r
 \r
        /* Public Interface - May be used in end-application: */\r
                /* Enums: */                    \r
index 520ef2f..ecb83bb 100644 (file)
@@ -31,6 +31,7 @@
   *    U4 series USB AVR parts\r
   *  - Fixed LowLevel MassStorage demo broken on the U2 AVRs due to double-banked endpoints\r
   *  - Fixed compilation error in the AudioInput demos when MICROPHONE_BIASED_TO_HALF_RAIL is defined (thanks to C. Scott Ananian)\r
+  *  - Fixed incorrect definition of HID_ALIGN_DATA() causing incorrect HID report item data alignment\r
   *\r
   *  \section Sec_ChangeLog100219 Version 100219\r
   *\r