From: Mike Playle Date: Thu, 1 Feb 2018 22:12:02 +0000 (+0000) Subject: Don't update pins on overflow in non-PWM modes X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=981994757450073ec8043105dedcf9b00d46f45b;p=sx%2Fsimavr.git Don't update pins on overflow in non-PWM modes --- diff --git a/simavr/sim/avr_timer.c b/simavr/sim/avr_timer.c index 6be4a29..2eb2009 100644 --- a/simavr/sim/avr_timer.c +++ b/simavr/sim/avr_timer.c @@ -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;