Fixed possible rounding in the VERSION_BCD() macros for some 0.01 step increments...
authorDean Camera <dean@fourwalledcubicle.com>
Wed, 12 Sep 2012 17:23:53 +0000 (17:23 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Wed, 12 Sep 2012 17:23:53 +0000 (17:23 +0000)
LUFA/DoxygenPages/ChangeLog.txt
LUFA/Drivers/USB/Core/StdDescriptors.h

index 0b35155..dfc6af6 100644 (file)
@@ -29,6 +29,7 @@
   *   - Fixed missing Win-32bit compatibility sections in the LUFA INF driver files (thanks to Christan Beharrell)
   *   - Fixed logic hole breaking USB operations on a USB controller with only one supported USB mode and no USB_DEVICE_ONLY or USB_HOST_ONLY
   *     configuration token set
+  *   - Fixed possible rounding in the VERSION_BCD() macros for some 0.01 step increments (thanks to Oliver Zander)
   *  - Library Applications:
   *   - Fixed broken RESET_TOGGLES_LIBUSB_COMPAT compile time option in the AVRISP-MKII project
   *   - Fixed incompatibility in the CDC class bootloader on some systems (thanks to Sylvain Munaut)
index 031e01d..1056f0f 100644 (file)
                /* Macros: */
                        #define VERSION_TENS(x)                   (int)((int)(x) / 10)
                        #define VERSION_ONES(x)                   (int)((int)(x) % 10)
-                       #define VERSION_TENTHS(x)                 (int)(((x *  1) - ((int)(x *  1))) * 10)
-                       #define VERSION_HUNDREDTHS(x)             (int)(((x * 10) - ((int)(x * 10))) * 10)
+                       #define VERSION_TENTHS(x)                 (int)((x - (int)x) * 10)
+                       #define VERSION_HUNDREDTHS(x)             (int)((x * 100) - ((int)(x * 10) * 10))
        #endif
 
        /* Disable C linkage for C++ Compilers: */