Skip to content

Commit 647b581

Browse files
authored
Merge pull request #10982 from jeromecoutant/PR_LPUART
STM32 LPUART minor update for easy maintenance
2 parents 34dd527 + 8a3fd6a commit 647b581

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

targets/TARGET_STM/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,12 @@ HAL_StatusTypeDef init_uart(serial_t *obj)
568568
#if defined(LPUART1_BASE)
569569
if (huart->Instance == LPUART1) {
570570
if (obj_s->baudrate <= 9600) {
571-
#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE) && !TARGET_STM32H7 && !TARGET_STM32WB
571+
#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE) && defined(USART_CR3_UCESM)
572572
HAL_UARTEx_EnableClockStopMode(huart);
573573
#endif
574574
HAL_UARTEx_EnableStopMode(huart);
575575
} else {
576-
#if (!defined(TARGET_STM32H7) && !defined(TARGET_STM32WB))
576+
#if defined(USART_CR3_UCESM)
577577
HAL_UARTEx_DisableClockStopMode(huart);
578578
#endif
579579
HAL_UARTEx_DisableStopMode(huart);

0 commit comments

Comments
 (0)