Commit 981994757450073ec8043105dedcf9b00d46f45b
authorMike Playle <mike@mythik.co.uk>
Thu, 1 Feb 2018 22:12:02 +0000 (22:12 +0000)
committerMike Playle <mike@mythik.co.uk>
Thu, 1 Feb 2018 22:30:38 +0000 (22:30 +0000)
simavr/sim/avr_timer.c

index 6be4a2931cb8fb0ab648ed8a7108ca03a761b997..2eb2009ea0b8e9262fcd97edef688fb6416b1dc3 100644 (file)
@@ -120,6 +120,11 @@ avr_timer_comp_on_tov(
        uint8_t mode = avr_regbit_get(avr, p->comp[comp].com);
        avr_irq_t * irq = &p->io.irq[TIMER_IRQ_OUT_COMP + comp];
 
+        // only PWM modes have special behaviour on overflow
+        if((p->wgm_op_mode_kind != avr_timer_wgm_pwm) &&
+           (p->wgm_op_mode_kind != avr_timer_wgm_fast_pwm))
+                return;
+
        switch (mode) {
                case avr_timer_com_normal: // Normal mode
                        break;