timer: Fix a subtle off-by-one bug in TCNT reading.
[simavr] / simavr / cores / sim_tinyx5.c
index 7b5e039..13b7366 100644 (file)
@@ -32,9 +32,12 @@ void tx5_init(struct avr_t * avr)
        printf("%s init\n", avr->mmcu);
 
        avr_eeprom_init(avr, &mcu->eeprom);
+       avr_watchdog_init(avr, &mcu->watchdog);
+       avr_extint_init(avr, &mcu->extint);
        avr_ioport_init(avr, &mcu->portb);
-       avr_timer8_init(avr, &mcu->timer0);
-       avr_timer8_init(avr, &mcu->timer1);
+       avr_adc_init(avr, &mcu->adc);
+       avr_timer_init(avr, &mcu->timer0);
+       avr_timer_init(avr, &mcu->timer1);
 }
 
 void tx5_reset(struct avr_t * avr)