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/200499
This commit is contained in:
David Hendricks
2014-05-19 16:24:17 -07:00
committed by chrome-internal-fetch
parent 876fe28e6f
commit f7403b11e2

View File

@@ -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));
}