drivers: serial: uart_stm32: tx/rx swap in init()
Previously, the uart_stm32 driver was extended in #44487 to support swapping the tx and rx pins of supported STM32 UART peripherals. However, the original change applied this configuration during the call to the uart_stm32_configure() function. This has now been added to the uart_stm32_init() function to ensure this behavior on startup for ports like the virtual com port. Signed-off-by: Peter Maxwell Warasila <madmaxwell@soundcomesout.com>
This commit is contained in:
parent
cefb004cd1
commit
3c09c21fda
1 changed files with 6 additions and 6 deletions
|
@ -473,12 +473,6 @@ static int uart_stm32_configure(const struct device *dev,
|
||||||
data->baud_rate = cfg->baudrate;
|
data->baud_rate = cfg->baudrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LL_USART_TXRX_SWAPPED
|
|
||||||
if (config->tx_rx_swap) {
|
|
||||||
LL_USART_SetTXRXSwap(config->usart, LL_USART_TXRX_SWAPPED);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
LL_USART_Enable(config->usart);
|
LL_USART_Enable(config->usart);
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
@ -1612,6 +1606,12 @@ static int uart_stm32_init(const struct device *dev)
|
||||||
LL_USART_EnableHalfDuplex(config->usart);
|
LL_USART_EnableHalfDuplex(config->usart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LL_USART_TXRX_SWAPPED
|
||||||
|
if (config->tx_rx_swap) {
|
||||||
|
LL_USART_SetTXRXSwap(config->usart, LL_USART_TXRX_SWAPPED);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
LL_USART_Enable(config->usart);
|
LL_USART_Enable(config->usart);
|
||||||
|
|
||||||
#ifdef USART_ISR_TEACK
|
#ifdef USART_ISR_TEACK
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue