summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2014-05-19 16:24:17 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-21 04:18:27 +0000
commitf7403b11e2396abf972c49a79be09495ee09240c (patch)
treed61b420b7ad0507738e00eb80704c0ed114ed5da
parent876fe28e6f48c331182441fbad50ae8868a2d1f7 (diff)
downloadchrome-ec-stabilize-5875.B.tar.gz
stm32: Enable USART TCIE after clearing TCstabilize-5875.B
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/200499
-rw-r--r--chip/stm32/uart.c3
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));
}