diff options
author | David Hendricks <dhendrix@chromium.org> | 2014-05-19 16:24:17 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-20 00:15:17 +0000 |
commit | ef7cae1c3af86f43c633443bb9750460c19aabea (patch) | |
tree | 3d01403f20957f980b06a77e273e1ddee6da7126 | |
parent | dd028dc153de778a91a78ecf01971bec606b8f31 (diff) | |
download | chrome-ec-ef7cae1c3af86f43c633443bb9750460c19aabea.tar.gz |
stm32: Enable USART TCIE after clearing TC
After clearing the TC flag, we should re-enable TCIE so that when
the DMA transfer is done we re-interrupt and allow
uart_process_output() to continue printing whatever is in the
circular buffer (in the case of wrap-around) or finish gracefully
if there is nothing left in the buffer.
BUG=chrome-os-partner:28837
BRANCH=nyan
TEST=Commands now reliably print full output whereas before they
might appear truncated until another interrupt was triggered to
finish printing the buffer.
Change-Id: I0a4236139f57812f384e2b99af45195537201a04
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/200512
-rw-r--r-- | chip/stm32/uart.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chip/stm32/uart.c b/chip/stm32/uart.c index e693d4ecaa..6221b62e9e 100644 --- a/chip/stm32/uart.c +++ b/chip/stm32/uart.c @@ -96,6 +96,9 @@ void uart_tx_dma_start(const char *src, int len) /* Force clear TC so we don't re-interrupt */ STM32_USART_SR(UARTN) &= ~STM32_USART_SR_TC; + /* Enable TCIE (chrome-os-partner:28837) */ + STM32_USART_CR1(UARTN) |= STM32_USART_CR1_TCIE; + /* Start DMA */ dma_go(dma_get_channel(dma_tx_option.channel)); } |