aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2019-06-29 16:30:07 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2019-06-29 16:30:07 +0000
commit5852906e41f54f7bef9ad06faa247bfa2d6d2060 (patch)
tree670bb7e9fd3ef1f52cdcc188c9e663758744949b
parent7e7c7d4cea1abf1c0e606b4507cbdb81f968a39e (diff)
downloadChibiOS-5852906e41f54f7bef9ad06faa247bfa2d6d2060.tar.gz
ChibiOS-5852906e41f54f7bef9ad06faa247bfa2d6d2060.tar.bz2
ChibiOS-5852906e41f54f7bef9ad06faa247bfa2d6d2060.zip
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
-rw-r--r--os/rt/include/chtime.h6
1 files 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));
}
/** @} */