From cb725828056b9564ab5d723bd0738375a83c077c Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Fri, 13 Oct 2017 12:35:40 +0000 Subject: Fixed and optimizations, NOW it seems to work for intervals larger than system time. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/rt5_dev_point1@10818 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chtime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'os/rt/include/chtime.h') diff --git a/os/rt/include/chtime.h b/os/rt/include/chtime.h index e2e3402ef..701dfb4d5 100644 --- a/os/rt/include/chtime.h +++ b/os/rt/include/chtime.h @@ -488,7 +488,7 @@ static inline systime_t chTimeAddX(systime_t systime, */ static inline sysinterval_t chTimeDiffX(systime_t start, systime_t end) { - return (sysinterval_t)(end - start); + return (sysinterval_t)((systime_t)(end - start)); } @@ -509,7 +509,7 @@ static inline bool chTimeIsInRangeX(systime_t time, systime_t start, systime_t end) { - return (bool)((systime_t)(time - start) < (systime_t)(end - start)); + return (bool)((time - start) < (end - start)); } /** @} */ -- cgit v1.2.3