Commit 80b8c501 authored by Erwan Gouriou's avatar Erwan Gouriou Committed by Anas Nashif
Browse files

drivers/serial: stm32: simplify check of TEACK/REACK flags



Remove reference to SoC series in activation of TEACK/REACK flags
checks. Use flags definitions instead which is defined, if supported,
in STM32Cube packages.
Decouple the checks since REACK is not supported in some series.

Signed-off-by: default avatarErwan Gouriou <erwan.gouriou@linaro.org>
parent 03f2eb7f
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -331,12 +331,17 @@ static int uart_stm32_init(struct device *dev)

	LL_USART_Enable(UartInstance);

#if !defined(CONFIG_SOC_SERIES_STM32F4X) && !defined(CONFIG_SOC_SERIES_STM32F1X)
	/* Polling USART initialisation */
	while ((!(LL_USART_IsActiveFlag_TEACK(UartInstance))) ||
	      (!(LL_USART_IsActiveFlag_REACK(UartInstance))))
#ifdef USART_ISR_TEACK
	/* Wait until TEACK flag is set */
	while (!(LL_USART_IsActiveFlag_TEACK(UartInstance)))
		;
#endif /* !CONFIG_SOC_SERIES_STM32F4X */
#endif /* !USART_ISR_TEACK */

#ifdef USART_ISR_REACK
	/* Wait until TEACK flag is set */
	while (!(LL_USART_IsActiveFlag_REACK(UartInstance)))
		;
#endif /* !USART_ISR_REACK */

#ifdef CONFIG_UART_INTERRUPT_DRIVEN
	config->uconf.irq_config_func(dev);