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

ztimer: fix ztimer_spin() time_left == duration case

This commit is contained in:
Kaspar Schleiser 2020-09-29 11:23:28 +02:00
parent 2c6693d68e
commit 07a1dde684

View File

@ -456,7 +456,7 @@ void ztimer_sleep(ztimer_clock_t *clock, uint32_t duration);
*/
static inline void ztimer_spin(ztimer_clock_t *clock, uint32_t duration) {
uint32_t end = ztimer_now(clock) + duration;
while ((end - ztimer_now(clock)) < duration) {}
while ((end - ztimer_now(clock)) <= duration) {}
}
/**