Commit 5c3675cd3770a69b72bfc6b95429ad6f7aa163aa
authorMichel Pollet <buserror@gmail.com>
Wed, 16 Feb 2011 00:02:01 +0000 (00:02 +0000)
committerMichel Pollet <buserror@gmail.com>
Wed, 16 Feb 2011 00:02:01 +0000 (00:02 +0000)
and also don't [rint one for "mormal" mode

Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/avr_timer.c

index ae163088ee2c4d3a9075d2adabe765b47f56b7dc..3912e59b6f264541e47f6d7a1e80e3f5a5b4ad7a 100644 (file)
@@ -272,6 +272,9 @@ static void avr_timer_write_ocr(struct avr_t * avr, avr_io_addr_t addr, uint8_t
        avr_core_watch_write(avr, addr, v);
 
        switch (p->mode.kind) {
+               case avr_timer_wgm_normal:
+                       avr_timer_reconfigure(p);
+                       break;
                case avr_timer_wgm_pwm:
                        if (p->mode.top != avr_timer_wgm_reg_ocra) {
                                avr_raise_irq(p->io.irq + TIMER_IRQ_OUT_PWM0, _timer_get_ocr(p, AVR_TIMER_COMPA));
@@ -283,7 +286,7 @@ static void avr_timer_write_ocr(struct avr_t * avr, avr_io_addr_t addr, uint8_t
                        avr_raise_irq(p->io.irq + TIMER_IRQ_OUT_PWM1, _timer_get_ocr(p, AVR_TIMER_COMPB));
                        break;
                default:
-                       printf("%s-%c mode %d\n", __FUNCTION__, p->name, p->mode.kind);
+                       printf("%s-%c mode %d UNSUPORTED\n", __FUNCTION__, p->name, p->mode.kind);
                        avr_timer_reconfigure(p);
                        break;
        }