From 90bfb952606a1ab8a46b6e2fa1ab18aa8a319a4d Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Tue, 7 Mar 2017 18:41:06 +0000 Subject: [PATCH] simavr: Wiggled the log levels. Added a new LOG_OUTPUT, and a new LOG_DEBUG. Hopefully this will allow running run_avr without -v to get the expected output. Signed-off-by: Michel Pollet --- simavr/sim/avr_uart.c | 3 ++- simavr/sim/sim_avr.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/simavr/sim/avr_uart.c b/simavr/sim/avr_uart.c index d000537..49ac1b2 100644 --- a/simavr/sim/avr_uart.c +++ b/simavr/sim/avr_uart.c @@ -269,7 +269,8 @@ avr_uart_udr_write( p->stdio_out[p->stdio_len] = 0; if (v == '\n' || p->stdio_len == maxsize) { p->stdio_len = 0; - AVR_LOG(avr, LOG_TRACE, FONT_GREEN "%s\n" FONT_DEFAULT, p->stdio_out); + AVR_LOG(avr, LOG_OUTPUT, + FONT_GREEN "%s\n" FONT_DEFAULT, p->stdio_out); } } TRACE(printf("UDR%c(%02x) = %02x\n", p->name, addr, v);) diff --git a/simavr/sim/sim_avr.h b/simavr/sim/sim_avr.h index 87c5e72..f4a4eac 100644 --- a/simavr/sim/sim_avr.h +++ b/simavr/sim/sim_avr.h @@ -67,10 +67,12 @@ enum { * The current log level is kept in avr->log. */ enum { - LOG_OUTPUT = 0, + LOG_NONE = 0, + LOG_OUTPUT, LOG_ERROR, LOG_WARNING, LOG_TRACE, + LOG_DEBUG, }; @@ -300,7 +302,7 @@ typedef struct avr_t { // DEBUG ONLY -- value ignored if CONFIG_SIMAVR_TRACE = 0 uint8_t trace : 1, - log : 2; // log level, default to 1 + log : 4; // log level, default to 1 // Only used if CONFIG_SIMAVR_TRACE is defined struct avr_trace_data_t *trace_data; -- 2.39.5