1
0
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:
Kaspar Schleiser 2014-08-29 12:12:20 +02:00
commit 334375046d

View File

@ -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),