aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-06-27 14:54:09 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-06-27 14:54:09 +0000
commit1a100c442a84fd82ac3836b0baa1667580ab9d67 (patch)
tree2daaffaca4e8cf4dc4152e058e2586897bef8af9
parentcf4c8b528179f63663763536892ef20ed7ebadfb (diff)
downloadChibiOS-1a100c442a84fd82ac3836b0baa1667580ab9d67.tar.gz
ChibiOS-1a100c442a84fd82ac3836b0baa1667580ab9d67.tar.bz2
ChibiOS-1a100c442a84fd82ac3836b0baa1667580ab9d67.zip
Fixed bug #418.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5899 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/kernel/include/chvt.h8
-rw-r--r--readme.txt2
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,