summaryrefslogtreecommitdiff
path: root/common/uart_buffering.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-06-26 17:12:29 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-27 20:50:56 +0000
commit88f6aafde91413eebca7d9c856fcca194b92f873 (patch)
tree68799a0548f0523f6cb8104e903cd120e986e6ac /common/uart_buffering.c
parentc4408e189736b45f275adfd3eb388fde3f457f62 (diff)
downloadchrome-ec-88f6aafde91413eebca7d9c856fcca194b92f873.tar.gz
uart_buffering: add tx_buffer_full() API
To aid in system level UART console performance testing a test function needs to know when the UART console buffer is full. This patch provides an API for that. BRANCH=none BUG=b:38448364 TEST=verified proper operation of the chargen CLI command which uses this API. Change-Id: I5fbc6cf4031a5077c91cd4bb85ab6f4dfb18821e Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1679710 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'common/uart_buffering.c')
-rw-r--r--common/uart_buffering.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/uart_buffering.c b/common/uart_buffering.c
index d0f302396f..9eb6db5cdf 100644
--- a/common/uart_buffering.c
+++ b/common/uart_buffering.c
@@ -338,6 +338,11 @@ int uart_buffer_empty(void)
return tx_buf_head == tx_buf_tail;
}
+int uart_buffer_full(void)
+{
+ return TX_BUF_NEXT(tx_buf_head) == tx_buf_tail;
+}
+
#ifdef CONFIG_UART_RX_DMA
static void uart_rx_dma_init(void)
{
@@ -466,3 +471,4 @@ int uart_console_read_buffer(uint8_t type,
return EC_RES_SUCCESS;
}
+