diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-16 10:22:31 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-16 10:22:31 +0000 |
commit | 471877bf143ed92f3de3c12256f4d9c8f460e1cc (patch) | |
tree | 1fd1453322b9a59fd1281a9da91cfc2199e5deb5 /os/rt | |
parent | 2a6e9954313262dab8b0c903c3d03e5a0726173e (diff) | |
download | ChibiOS-471877bf143ed92f3de3c12256f4d9c8f460e1cc.tar.gz ChibiOS-471877bf143ed92f3de3c12256f4d9c8f460e1cc.tar.bz2 ChibiOS-471877bf143ed92f3de3c12256f4d9c8f460e1cc.zip |
Better implementation of chSysIsCounterWithinX().
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7777 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt')
-rw-r--r-- | os/rt/src/chsys.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c index a9fd3aa53..fad84179e 100644 --- a/os/rt/src/chsys.c +++ b/os/rt/src/chsys.c @@ -272,8 +272,7 @@ void chSysRestoreStatusX(syssts_t sts) { */
bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end) {
- return (end > start) ? ((cnt >= start) && (cnt < end)) :
- ((cnt >= start) || (cnt < end));
+ return (bool)((cnt - start) < (end - start));
}
/**
|