diff options
author | Jett Rink <jettrink@chromium.org> | 2019-05-29 15:00:41 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-30 22:02:08 -0700 |
commit | b5909b6d0acd92de66ac21415c24154110574693 (patch) | |
tree | 98c996a5b18ffeec8e773349bccb911533f2a37a /chip | |
parent | c718b87d8c8b7b65a292b54dfb9d3957b4552329 (diff) | |
download | chrome-ec-b5909b6d0acd92de66ac21415c24154110574693.tar.gz |
ish: remove unnecessary task switch for UART
When starting to send UART data, we do not need to invoke the ISR for
the UART. That only needs to be invoked if there is incoming RX messages
(which it still is invoked) or the FIFO can accept more data and was
full before.
BRANCH=none
BUG=none
TEST=console input and output still works and takes much less time.
Change-Id: Ib05c66ee704aad2d93836709bc6b706c627285c5
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1634620
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/ish/uart.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/chip/ish/uart.c b/chip/ish/uart.c index e512b53588..1e5963daf2 100644 --- a/chip/ish/uart.c +++ b/chip/ish/uart.c @@ -73,8 +73,6 @@ void uart_tx_start(void) disable_sleep(SLEEP_MASK_UART); IER(ISH_DEBUG_UART) |= IER_TDRQ; - - task_trigger_irq(ISH_DEBUG_UART_IRQ); } } @@ -98,7 +96,7 @@ void uart_tx_flush(void) int uart_tx_ready(void) { - return 1; + return LSR(ISH_DEBUG_UART) & LSR_TDRQ; } int uart_rx_available(void) @@ -112,7 +110,7 @@ int uart_rx_available(void) void uart_write_char(char c) { /* Wait till reciever is ready */ - while ((LSR(ISH_DEBUG_UART) & LSR_TEMT) == 0) + while (!uart_tx_ready()) continue; THR(ISH_DEBUG_UART) = c; |