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:
parent
2a6e995431
commit
471877bf14
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue