Commit 90bfb952606a1ab8a46b6e2fa1ab18aa8a319a4d
authorMichel Pollet <buserror@gmail.com>
Tue, 7 Mar 2017 18:41:06 +0000 (18:41 +0000)
committerMichel Pollet <buserror@gmail.com>
Tue, 7 Mar 2017 18:41:06 +0000 (18:41 +0000)
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 <buserror@gmail.com>
2 files changed:
simavr/sim/avr_uart.c
simavr/sim/sim_avr.h

index d0005373066993afa8a5e3edd2df3c19825a48fa..49ac1b285e7c48961009c986fb41ba84db0ab137 100644 (file)
@@ -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);)
index 87c5e724029edf0ff3d29ef6f50e2500214d4072..f4a4eac22f0e4fda8ba51a8a26d4619a9682270a 100644 (file)
@@ -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;