From 1a100c442a84fd82ac3836b0baa1667580ab9d67 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 27 Jun 2013 14:54:09 +0000 Subject: [PATCH] Fixed bug #418. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5899 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chvt.h | 8 +++++--- readme.txt | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/os/kernel/include/chvt.h b/os/kernel/include/chvt.h index 97a04d81e..27baea6a4 100644 --- a/os/kernel/include/chvt.h +++ b/os/kernel/include/chvt.h @@ -44,7 +44,7 @@ * @api */ #define S2ST(sec) \ - ((systime_t)((sec) * CH_FREQUENCY)) + ((systime_t)(((uint32_t)(sec)) * ((uint32_t)CH_FREQUENCY))) /** * @brief Milliseconds to system ticks. @@ -57,7 +57,8 @@ * @api */ #define MS2ST(msec) \ - ((systime_t)((((msec) * CH_FREQUENCY - 1L) / 1000L) + 1L)) + ((systime_t)(((((uint32_t)(msec)) * ((uint32_t)CH_FREQUENCY) - 1UL) / \ + 1000UL) + 1UL)) /** * @brief Microseconds to system ticks. @@ -70,7 +71,8 @@ * @api */ #define US2ST(usec) \ - ((systime_t)((((usec) * CH_FREQUENCY - 1L) / 1000000L) + 1L)) + ((systime_t)(((((uint32_t)(usec)) * ((uint32_t)CH_FREQUENCY) - 1UL) / \ + 1000000UL) + 1UL)) /** @} */ /** diff --git a/readme.txt b/readme.txt index 89b08a66a..7a853273f 100644 --- a/readme.txt +++ b/readme.txt @@ -89,6 +89,8 @@ ***************************************************************************** *** 2.7.0 *** +- FIX: Fixed missing casts in time-conversion macros (bug #418)(backported + to 2.6.1, 2.4.4 and 2.2.10). - FIX: Fixed STM32 Serial (v2) driver invalid CR registers size (bug #416) (backported to 2.6.0). - FIX: Fixed MS2ST() and US2ST() macros error (bug #415)(backported to 2.6.0,