ztimer: use uint32_t in ztimer_periodic_wakeup
This ensures compatibility with xtimer_periodic_wakeup() in case ztimer_now64 is used.
This commit is contained in:
parent
4db8a1f602
commit
ff1ea0bfb1
@ -55,14 +55,13 @@ void ztimer_sleep(ztimer_clock_t *clock, uint32_t duration)
|
|||||||
mutex_lock(&mutex);
|
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)
|
uint32_t period)
|
||||||
{
|
{
|
||||||
unsigned state = irq_disable();
|
unsigned state = irq_disable();
|
||||||
ztimer_now_t now = ztimer_now(clock);
|
uint32_t now = ztimer_now(clock);
|
||||||
ztimer_now_t target = *last_wakeup + period;
|
uint32_t target = *last_wakeup + period;
|
||||||
ztimer_now_t offset = target - now;
|
uint32_t offset = target - now;
|
||||||
|
|
||||||
irq_restore(state);
|
irq_restore(state);
|
||||||
|
|
||||||
if (offset <= period) {
|
if (offset <= period) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user