mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #1617 from rousselk/hwtimer-spin-ovf-fix
Ensure hwtimer_spin() won't wait for an unreachable stop counter value
This commit is contained in:
commit
334375046d
@ -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