diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/rt/src/chevents.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/os/rt/src/chevents.c b/os/rt/src/chevents.c index 4385257b3..2db6fdd9b 100644 --- a/os/rt/src/chevents.c +++ b/os/rt/src/chevents.c @@ -384,7 +384,7 @@ eventmask_t chEvtWaitOne(eventmask_t events) { chSchGoSleepS(CH_STATE_WTOREVT);
m = ctp->p_epending & events;
}
- m &= -m;
+ m ^= m & (m - 1);
ctp->p_epending &= ~m;
chSysUnlock();
@@ -488,7 +488,7 @@ eventmask_t chEvtWaitOneTimeout(eventmask_t events, systime_t time) { }
m = ctp->p_epending & events;
}
- m &= -m;
+ m ^= m & (m - 1);
ctp->p_epending &= ~m;
chSysUnlock();
|