mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Ensure hwtimer_spin() won't wait for an unreachable stop counter value
without using a costly MOD operation
This commit is contained in:
parent
752fe547ca
commit
d1cf9c4bfd
@ -68,7 +68,7 @@ void hwtimer_spin(unsigned long ticks)
|
||||
|
||||
unsigned long start = hwtimer_arch_now();
|
||||
/* compute destination time, possibly resulting in an overflow */
|
||||
unsigned long stop = start + ticks;
|
||||
unsigned long stop = ((start + ticks) & HWTIMER_MAXTICKS);
|
||||
|
||||
/*
|
||||
* If there is an overflow (that is: stop time is inferior to start),
|
||||
|
Loading…
Reference in New Issue
Block a user