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: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
03f2eb7f32
commit
80b8c501c9
1 changed files with 10 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue