From ff1ea0bfb15642fa5f60be9f0ae0fea4224d4f4c Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Wed, 9 Sep 2020 12:48:28 +0200 Subject: [PATCH] ztimer: use uint32_t in ztimer_periodic_wakeup This ensures compatibility with xtimer_periodic_wakeup() in case ztimer_now64 is used. --- sys/ztimer/util.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/ztimer/util.c b/sys/ztimer/util.c index e8074f6ebf..115af57d40 100644 --- a/sys/ztimer/util.c +++ b/sys/ztimer/util.c @@ -55,14 +55,13 @@ void ztimer_sleep(ztimer_clock_t *clock, uint32_t duration) mutex_lock(&mutex); } -void ztimer_periodic_wakeup(ztimer_clock_t *clock, ztimer_now_t *last_wakeup, +void ztimer_periodic_wakeup(ztimer_clock_t *clock, uint32_t *last_wakeup, uint32_t period) { unsigned state = irq_disable(); - ztimer_now_t now = ztimer_now(clock); - ztimer_now_t target = *last_wakeup + period; - ztimer_now_t offset = target - now; - + uint32_t now = ztimer_now(clock); + uint32_t target = *last_wakeup + period; + uint32_t offset = target - now; irq_restore(state); if (offset <= period) {