From: Jakob Gruber Date: Thu, 2 Aug 2012 08:49:06 +0000 (+0200) Subject: watchdog: Convert logging to AVR_LOG() X-Git-Tag: v1.0~21 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=22b130eb4168554276267e4cb325a7485dce2709;p=sx%2Fsimavr.git watchdog: Convert logging to AVR_LOG() --- diff --git a/simavr/sim/avr_watchdog.c b/simavr/sim/avr_watchdog.c index 763a762..e70521d 100644 --- a/simavr/sim/avr_watchdog.c +++ b/simavr/sim/avr_watchdog.c @@ -28,11 +28,11 @@ static avr_cycle_count_t avr_watchdog_timer(struct avr_t * avr, avr_cycle_count_ { avr_watchdog_t * p = (avr_watchdog_t *)param; - printf("WATCHDOG timer fired.\n"); + AVR_LOG(avr, LOG_TRACE, "WATCHDOG: timer fired.\n"); avr_raise_interrupt(avr, &p->watchdog); if (!avr_regbit_get(avr, p->watchdog.enable)) { - printf("WATCHDOG timer fired and interrupt is not enabled. Quitting\n"); + AVR_LOG(avr, LOG_ERROR, "WATCHDOG: timer fired and interrupt is not enabled. Quitting\n"); avr_sadly_crashed(avr, 10); } @@ -71,10 +71,11 @@ static void avr_watchdog_write(avr_t * avr, avr_io_addr_t addr, uint8_t v, void p->cycle_count = 2048 << wdp; p->cycle_count = (p->cycle_count * avr->frequency) / 128000; if (avr_regbit_get(avr, p->wde)) { - printf("Watchdog reset to %d cycles @ 128kz (* %d) = %d CPU cycles)\n", 2048 << wdp, 1 << wdp, (int)p->cycle_count); + AVR_LOG(avr, LOG_TRACE, "WATCHDOG: reset to %d cycles @ 128kz (* %d) = %d CPU cycles)\n", + 2048 << wdp, 1 << wdp, (int)p->cycle_count); avr_cycle_timer_register(avr, p->cycle_count, avr_watchdog_timer, p); } else { - printf("Watchdog disabled\n"); + AVR_LOG(avr, LOG_TRACE, "WATCHDOG: disabled\n"); avr_cycle_timer_cancel(avr, avr_watchdog_timer, p); } } else {