From d784bdd3232472f44a1c49c78f68912b109f849c Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Sun, 20 Jun 2010 11:25:53 +0100 Subject: [PATCH] timer: Also reconfigure on writing the WGM bits Some broken code configure the clock source before setting the waveform bits. Signed-off-by: Michel Pollet --- simavr/sim/avr_timer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/simavr/sim/avr_timer.c b/simavr/sim/avr_timer.c index ce66983..5d658a5 100644 --- a/simavr/sim/avr_timer.c +++ b/simavr/sim/avr_timer.c @@ -407,6 +407,7 @@ void avr_timer_init(avr_t * avr, avr_timer_t * p) avr_register_vector(avr, &p->overflow); avr_register_vector(avr, &p->icr); + avr_register_io_write(avr, p->wgm[0].reg, avr_timer_write, p); avr_register_io_write(avr, p->cs[0].reg, avr_timer_write, p); // this assumes all the "pending" interrupt bits are in the same -- 2.39.5