drivers: serial: stm32: Fix compile issues
The stm32 uart driver fails to build on certian platforms due to
changes introduced by:
commit 3c18bcbf77
Author: Francois Ramu <francois.ramu@st.com>
Date: Wed Jan 27 10:27:33 2021 +0100
drivers: serial: stm32 restore uart after lowpower
Fix this by adding some ifdef's around the code that is specific to the
given platforms that the code works on.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
951c99c61a
commit
5a9f997a80
1 changed files with 4 additions and 0 deletions
|
@ -1393,14 +1393,18 @@ static int uart_stm32_set_power_state(const struct device *dev,
|
|||
|
||||
/* setting a low power mode */
|
||||
if (new_state != DEVICE_PM_ACTIVE_STATE) {
|
||||
#ifdef USART_ISR_BUSY
|
||||
/* Make sure that no USART transfer is on-going */
|
||||
while (LL_USART_IsActiveFlag_BUSY(UartInstance) == 1) {
|
||||
}
|
||||
#endif
|
||||
while (LL_USART_IsActiveFlag_TC(UartInstance) == 0) {
|
||||
}
|
||||
#ifdef USART_ISR_REACK
|
||||
/* Make sure that USART is ready for reception */
|
||||
while (LL_USART_IsActiveFlag_REACK(UartInstance) == 0) {
|
||||
}
|
||||
#endif
|
||||
/* Clear OVERRUN flag */
|
||||
LL_USART_ClearFlag_ORE(UartInstance);
|
||||
/* Leave UartInstance unchanged */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue