aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/include/nil.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/nil/include/nil.h')
-rw-r--r--os/nil/include/nil.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/os/nil/include/nil.h b/os/nil/include/nil.h
index 3babb8da9..e17aeef99 100644
--- a/os/nil/include/nil.h
+++ b/os/nil/include/nil.h
@@ -596,8 +596,8 @@ struct nil_system {
* @api
*/
#define MS2ST(msec) \
- ((systime_t)((((((uint32_t)(msec)) * \
- ((uint32_t)NIL_CFG_ST_FREQUENCY)) - 1UL) / 1000UL) + 1UL))
+ ((systime_t)((((uint32_t)(msec)) * \
+ ((uint32_t)NIL_CFG_ST_FREQUENCY) + 999UL) / 1000UL))
/**
* @brief Microseconds to system ticks.
@@ -610,8 +610,8 @@ struct nil_system {
* @api
*/
#define US2ST(usec) \
- ((systime_t)((((((uint32_t)(usec)) * \
- ((uint32_t)NIL_CFG_ST_FREQUENCY)) - 1UL) / 1000000UL) + 1UL))
+ ((systime_t)((((uint32_t)(usec)) * \
+ ((uint32_t)NIL_CFG_ST_FREQUENCY) + 999999UL) / 1000000UL))
/** @} */
/**