From 573e695a69ffd8e1bfc5d8507ebc3dfc3e2647ff Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Fri, 13 Sep 2013 11:22:19 -0700 Subject: Simplify uart_tx_start() All calls to it did if (uart_tx_stopped()) uart_tx_start(); And that was the only use of uart_tx_stopped(). Merge the functions. BUG=chrome-os-partner:20485 BRANCH=none TEST=EC debug console still prints output and accepts commands. Ctrl+Q pauses output and Ctrl+S resumes it. Change-Id: I113c64f5fdfc6b02b63034a74b1a3c6c6a76c351 Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/169329 Reviewed-by: Bill Richardson --- common/uart_buffering.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'common/uart_buffering.c') diff --git a/common/uart_buffering.c b/common/uart_buffering.c index 784e117503..560e783c41 100644 --- a/common/uart_buffering.c +++ b/common/uart_buffering.c @@ -146,8 +146,7 @@ void uart_process_input(void) } else if (c == CTRL('S')) { /* Software flow control - XON */ uart_suspended = 0; - if (uart_tx_stopped()) - uart_tx_start(); + uart_tx_start(); } else if (rx_buf_next != rx_buf_tail) { /* Buffer all other input */ rx_buf[rx_buf_head] = c; @@ -165,7 +164,7 @@ int uart_putc(int c) { int rv = __tx_char(NULL, c); - if (!uart_suspended && uart_tx_stopped()) + if (!uart_suspended) uart_tx_start(); return rv ? EC_ERROR_OVERFLOW : EC_SUCCESS; @@ -179,7 +178,7 @@ int uart_puts(const char *outstr) break; } - if (!uart_suspended && uart_tx_stopped()) + if (!uart_suspended) uart_tx_start(); /* Successful if we consumed all output */ @@ -190,7 +189,7 @@ int uart_vprintf(const char *format, va_list args) { int rv = vfnprintf(__tx_char, NULL, format, args); - if (!uart_suspended && uart_tx_stopped()) + if (!uart_suspended) uart_tx_start(); return rv; @@ -222,7 +221,7 @@ void uart_flush_output(void) * we're in now. */ uart_process_output(); - } else if (uart_tx_stopped()) { + } else { /* * It's possible we switched from a previous context * which was doing a printf() or puts() but hadn't -- cgit v1.2.1