1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

xtimer: Handle overflows in xtimer_spin()

This commit is contained in:
Joakim Nohlgård 2015-10-28 07:38:12 +01:00
parent 41ae0af3e2
commit d95e7a3572

View File

@ -484,7 +484,12 @@ static inline void xtimer_spin_until(uint32_t target) {
static inline void xtimer_spin(uint32_t offset) {
uint32_t start = _lltimer_now();
#if XTIMER_MASK
offset = _lltimer_mask(offset);
while (_lltimer_mask(_lltimer_now() - start) < offset);
#else
while ((_lltimer_now() - start) < offset);
#endif
}
static inline void xtimer_usleep(uint32_t microseconds)