From: Michel Pollet Date: Wed, 16 Feb 2011 00:02:01 +0000 (+0000) Subject: timers: Print a warning on unsuported timer modes X-Git-Tag: v1.0a7~41 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=5c3675cd3770a69b72bfc6b95429ad6f7aa163aa;p=sx%2Fsimavr.git timers: Print a warning on unsuported timer modes and also don't [rint one for "mormal" mode Signed-off-by: Michel Pollet --- diff --git a/simavr/sim/avr_timer.c b/simavr/sim/avr_timer.c index ae16308..3912e59 100644 --- a/simavr/sim/avr_timer.c +++ b/simavr/sim/avr_timer.c @@ -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; }