From 3e71eee97c73bdac8fec33bfdc4f343bc267d049 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 4 Aug 2014 13:12:00 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7120 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chvt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'os/rt/include/chvt.h') diff --git a/os/rt/include/chvt.h b/os/rt/include/chvt.h index 2ddfc26c7..4e257887d 100644 --- a/os/rt/include/chvt.h +++ b/os/rt/include/chvt.h @@ -146,7 +146,7 @@ * * @api */ -#define ST2S(n) ((((n) - 1UL) / CH_CFG_ST_FREQUENCY) + 1UL) +#define ST2S(n) (((((n) - 1UL) * 1UL) / CH_CFG_ST_FREQUENCY) + 1UL) /** * @brief System ticks to milliseconds. @@ -158,7 +158,7 @@ * * @api */ -#define ST2MS(n) ((((n) - 1UL) / (CH_CFG_ST_FREQUENCY / 1000UL)) + 1UL) +#define ST2MS(n) (((((n) - 1UL) * 1000UL) / CH_CFG_ST_FREQUENCY) + 1UL) /** * @brief System ticks to microseconds. @@ -170,7 +170,7 @@ * * @api */ -#define ST2US(n) ((((n) - 1UL) / (CH_CFG_ST_FREQUENCY / 1000000UL)) + 1UL) +#define ST2US(n) (((((n) - 1UL) * 1000000UL) / CH_CFG_ST_FREQUENCY) + 1UL) /** @} */ /*===========================================================================*/ -- cgit v1.2.3