aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c')
-rw-r--r--os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
index f00fa28ef..505cd537a 100644
--- a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
+++ b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
@@ -953,9 +953,10 @@ void uart_lld_start_send(UARTDriver *uartp, size_t n, const void *txbuf) {
dmaStreamSetMode(uartp->dmatx, uartp->dmamode | STM32_DMA_CR_DIR_M2P |
STM32_DMA_CR_MINC | STM32_DMA_CR_TCIE);
- /* Only enable TC interrupt if there's a callback attached to it.
- Also we need to clear TC flag which could be set before. */
- if (uartp->config->txend2_cb != NULL) {
+ /* Only enable TC interrupt if there's a callback attached to it or
+ if called from uartSendFullTimeout(). Also we need to clear TC flag
+ which could be set before.*/
+ if ((uartp->config->txend2_cb != NULL) || (uartp->early == false)) {
uartp->usart->ICR = USART_ICR_TCCF;
uartp->usart->CR1 |= USART_CR1_TCIE;
}