diff options
-rw-r--r-- | os/kernel/include/chvt.h | 8 | ||||
-rw-r--r-- | 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,
|