From 1a100c442a84fd82ac3836b0baa1667580ab9d67 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 27 Jun 2013 14:54:09 +0000 Subject: 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 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'os/kernel/include/chvt.h') 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)) /** @} */ /** -- cgit v1.2.3