diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2019-02-05 16:00:11 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-02-08 06:03:47 -0800 |
commit | 0e23368429f931b8ead7abc1ac63aa0f96f51565 (patch) | |
tree | 29097a814451ec0fd119ee858560f9436fc94f3b /common | |
parent | b937f5c5b2bd54323b91f38be9650c975b00618c (diff) | |
download | chrome-ec-0e23368429f931b8ead7abc1ac63aa0f96f51565.tar.gz |
UART: Export uart_clear_input API
This patch exports the uart_clear_input API.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b/119329144
BRANCH=none
TEST=buildall
Change-Id: Ib78b9dbca8ef9efb21c566888fd495b6cf313ada
Reviewed-on: https://chromium-review.googlesource.com/1454987
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/uart_buffering.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/uart_buffering.c b/common/uart_buffering.c index 2b83cb7cfc..86d9f1df92 100644 --- a/common/uart_buffering.c +++ b/common/uart_buffering.c @@ -219,6 +219,14 @@ void uart_process_input(void) console_has_input(); } +void uart_clear_input(void) +{ + int scratch __attribute__ ((unused)); + while (uart_rx_available()) + scratch = uart_read_char(); + rx_buf_head = rx_buf_tail = 0; +} + #endif /* !CONFIG_UART_RX_DMA */ int uart_putc(int c) |