diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c | 7 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c b/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c index 6b36178ae..8cb5c1a8f 100644 --- a/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c +++ b/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c @@ -730,9 +730,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->SR = ~USART_SR_TC;
uartp->usart->CR1 |= USART_CR1_TCIE;
}
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;
}
|