From 5852906e41f54f7bef9ad06faa247bfa2d6d2060 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 29 Jun 2019 16:30:07 +0000 Subject: Back-ported an improvement from trunk. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_19.1.x@12847 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/rt/include/chtime.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/os/rt/include/chtime.h b/os/rt/include/chtime.h index 264ebcde3..608abe70e 100644 --- a/os/rt/include/chtime.h +++ b/os/rt/include/chtime.h @@ -160,7 +160,6 @@ typedef uint32_t time_conv_t; /* Module macros. */ /*===========================================================================*/ - /** * @name Fast time conversion utilities * @{ @@ -442,7 +441,7 @@ static inline systime_t chTimeAddX(systime_t systime, sysinterval_t interval) { #if CH_CFG_ST_RESOLUTION != CH_CFG_INTERVALS_SIZE - chDbgCheck(interval <= (sysinterval_t)((systime_t)-1)); + chDbgCheck(interval <= (sysinterval_t)TIME_MAX_SYSTIME); #endif return systime + (systime_t)interval; @@ -482,7 +481,8 @@ static inline bool chTimeIsInRangeX(systime_t time, systime_t start, systime_t end) { - return (bool)((time - start) < (end - start)); + return (bool)((systime_t)((systime_t)time - (systime_t)start) < + (systime_t)((systime_t)end - (systime_t)start)); } /** @} */ -- cgit v1.2.3