aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-09-12 17:23:53 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-09-12 17:23:53 +0000
commitcd40797a4df6d53cc932ba10bdcf88b321e29ed2 (patch)
treee3dd050c1039dc6fc78ecc4cd6425f78b7f838d7 /LUFA
parent6936fcbd60d4c76d83117181d98a87ec733e482f (diff)
downloadlufa-cd40797a4df6d53cc932ba10bdcf88b321e29ed2.tar.gz
lufa-cd40797a4df6d53cc932ba10bdcf88b321e29ed2.tar.bz2
lufa-cd40797a4df6d53cc932ba10bdcf88b321e29ed2.zip
Fixed possible rounding in the VERSION_BCD() macros for some 0.01 step increments (thanks to Oliver Zander).
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/DoxygenPages/ChangeLog.txt1
-rw-r--r--LUFA/Drivers/USB/Core/StdDescriptors.h4
2 files changed, 3 insertions, 2 deletions
diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt
index 0b351550e..dfc6af612 100644
--- a/LUFA/DoxygenPages/ChangeLog.txt
+++ b/LUFA/DoxygenPages/ChangeLog.txt
@@ -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)
diff --git a/LUFA/Drivers/USB/Core/StdDescriptors.h b/LUFA/Drivers/USB/Core/StdDescriptors.h
index 031e01d28..1056f0f96 100644
--- a/LUFA/Drivers/USB/Core/StdDescriptors.h
+++ b/LUFA/Drivers/USB/Core/StdDescriptors.h
@@ -724,8 +724,8 @@
/* 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: */