aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/osal
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-04-04 08:19:04 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-04-04 08:19:04 +0000
commit5047ce62e8c7c4b702d68f29dff42e65200924b1 (patch)
treebee619afb0cff832204cfcfd418f454742e7a4b2 /os/hal/osal
parentb3c635dc4b9ba6ae0d02d32e4ac5ecacbda73ca2 (diff)
downloadChibiOS-5047ce62e8c7c4b702d68f29dff42e65200924b1.tar.gz
ChibiOS-5047ce62e8c7c4b702d68f29dff42e65200924b1.tar.bz2
ChibiOS-5047ce62e8c7c4b702d68f29dff42e65200924b1.zip
Time conversion macros fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7851 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/osal')
-rw-r--r--os/hal/osal/os-less/ARMCMx/osal.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/os/hal/osal/os-less/ARMCMx/osal.h b/os/hal/osal/os-less/ARMCMx/osal.h
index 66cb594a5..c54ed9327 100644
--- a/os/hal/osal/os-less/ARMCMx/osal.h
+++ b/os/hal/osal/os-less/ARMCMx/osal.h
@@ -425,8 +425,8 @@ typedef struct {
* @api
*/
#define OSAL_MS2ST(msec) \
- ((systime_t)((((((uint32_t)(msec)) * \
- ((uint32_t)OSAL_ST_FREQUENCY)) - 1UL) / 1000UL) + 1UL))
+ ((systime_t)((((uint32_t)(msec)) * \
+ ((uint32_t)OSAL_ST_FREQUENCY) + 999UL) / 1000UL))
/**
* @brief Microseconds to system ticks.
@@ -439,8 +439,8 @@ typedef struct {
* @api
*/
#define OSAL_US2ST(usec) \
- ((systime_t)((((((uint32_t)(usec)) * \
- ((uint32_t)OSAL_ST_FREQUENCY)) - 1UL) / 1000000UL) + 1UL))
+ ((systime_t)((((uint32_t)(usec)) * \
+ ((uint32_t)OSAL_ST_FREQUENCY) + 999999UL) / 1000000UL))
/** @} */
/**