From 9e6cee086acda19221eec5fd4a463eb88fb073ef Mon Sep 17 00:00:00 2001 From: Andreas Schultes Date: Sat, 1 Jul 2017 22:06:16 +0200 Subject: [PATCH] fix timer is not triggered at ocr==0 --- simavr/sim/avr_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simavr/sim/avr_timer.c b/simavr/sim/avr_timer.c index e1e1397..fede329 100644 --- a/simavr/sim/avr_timer.c +++ b/simavr/sim/avr_timer.c @@ -498,13 +498,13 @@ avr_timer_configure( __FUNCTION__, p->name, top, 'A'+compi, ocr); } } - if (ocr && ocr <= top) { + if (ocr <= top) { p->comp[compi].comp_cycles = comp_cycles; if (p->trace & (avr_timer_trace_compa << compi)) printf( "TIMER: %s-%c %c %.2fHz = %d cycles\n", __FUNCTION__, p->name, - 'A'+compi, resulting_clock / ocr, + 'A'+compi, resulting_clock / (ocr+1), (int)comp_cycles); } } -- 2.39.5