From 8ebba6d27af1e4a0b1bf338d5bc423465a8625b7 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 10 Aug 2017 13:11:27 -0400 Subject: [PATCH] avr: Make sure timer_high and timer_event() stay in sync Schedule the next wakeup time of timer_event() using timer_high. Signed-off-by: Kevin O'Connor --- src/avr/timer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/avr/timer.c b/src/avr/timer.c index ae6c36cd..e40007d8 100644 --- a/src/avr/timer.c +++ b/src/avr/timer.c @@ -137,16 +137,20 @@ timer_read_time(void) static uint_fast8_t timer_event(struct timer *t) { + union u32_u *nextwake = (void*)&wrap_timer.waketime; if (TIFR1 & (1<