Better implementation of chSysIsCounterWithinX().

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7777 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2015-03-16 10:22:31 +00:00
parent 2a6e995431
commit 471877bf14
1 changed files with 1 additions and 2 deletions

View File

@ -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));
}
/**