drivers: serial: stm32 UART driver do not start Rx timer if null

This commit is optimizing the uart isr execution to avoid starting
the Rx timeout if it is null. In anycase the async_timer_start
function is checking the tiemout value. This will just save some
execution lines.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2022-08-31 12:13:41 +02:00 committed by Carles Cufí
commit 0300b34cf0

View file

@ -1024,12 +1024,12 @@ static void uart_stm32_isr(const struct device *dev)
LOG_DBG("idle interrupt occurred");
/* Start the RX timer */
async_timer_start(&data->dma_rx.timeout_work,
data->dma_rx.timeout);
if (data->dma_rx.timeout == 0) {
uart_stm32_dma_rx_flush(dev);
} else {
/* Start the RX timer not null */
async_timer_start(&data->dma_rx.timeout_work,
data->dma_rx.timeout);
}
} else if (LL_USART_IsEnabledIT_TC(config->usart) &&
LL_USART_IsActiveFlag_TC(config->usart)) {