diff options
Diffstat (limited to 'common/uart_buffering.c')
-rw-r--r-- | common/uart_buffering.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/common/uart_buffering.c b/common/uart_buffering.c index 6d08dbb9af..d83b34ea40 100644 --- a/common/uart_buffering.c +++ b/common/uart_buffering.c @@ -357,6 +357,7 @@ void uart_process(void) uart_tx_stop(); } + void uart_set_console_mode(int enable) { console_mode = enable; @@ -382,7 +383,7 @@ int uart_puts(const char *outstr) } -int uart_printf(const char *format, ...) +int uart_vprintf(const char *format, va_list args) { static const char int_chars[] = "0123456789abcdef"; static const char error_str[] = "ERROR"; @@ -394,12 +395,9 @@ int uart_printf(const char *format, ...) int is_left; int pad_zero; int pad_width; - va_list args; char *vstr; int vlen; - va_start(args, format); - while (*format && !dropped_chars) { int c = *format++; @@ -532,7 +530,6 @@ int uart_printf(const char *format, ...) vlen++; } } - va_end(args); if (uart_tx_stopped()) uart_tx_start(); @@ -541,6 +538,19 @@ int uart_printf(const char *format, ...) return dropped_chars ? EC_ERROR_OVERFLOW : EC_SUCCESS; } + +int uart_printf(const char *format, ...) +{ + int rv; + va_list args; + + va_start(args, format); + rv = uart_vprintf(format, args); + va_end(args); + return rv; +} + + void uart_flush_output(void) { /* Wait for buffer to empty */ |