From 78982ebb51b0895b3178a85edcb1543939dc13b4 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 6 Aug 2017 19:21:16 -0400 Subject: [PATCH] avr: Implement internal avr specific timer to handle 16bit overflows Don't rely on the generic scheduler code to always have a timer no more than 1ms in the future. Instead, create an avr specific timer that will be called every 0x8000 ticks. This simplifies the generic code and it reduces the amount of code that needs to be run every millisecond. Signed-off-by: Kevin O'Connor --- src/avr/timer.c | 32 +++++++++++++++++++++++++------- src/generic/misc.h | 1 - src/generic/timer_irq.c | 6 ------ src/sched.c | 13 ++++++------- src/simulator/main.c | 5 ----- 5 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/avr/timer.c b/src/avr/timer.c index a87ae206..1b281ec9 100644 --- a/src/avr/timer.c +++ b/src/avr/timer.c @@ -85,6 +85,15 @@ timer_kick(void) TIFR1 = 1<