Merge pull request #15004 from kaspar030/ztimer_periodic_wakeup_32bit
ztimer: use uint32_t in ztimer_periodic_wakeup
This commit is contained in:
commit
474cde6046
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user