Check LPUART clock source in STOP mode

Check LPUART clock source before enable it in STOP mode, only LSE could be enabled in STOP mode.
pull/8284/head
Eman869 2018-09-27 19:12:42 +08:00 committed by GitHub
parent 45f59f88c3
commit c68e7c61ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -536,7 +536,9 @@ HAL_StatusTypeDef init_uart(serial_t *obj)
#if defined(LPUART1_BASE)
if (huart->Instance == LPUART1) {
if (obj_s->baudrate <= 9600) {
#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE)
HAL_UARTEx_EnableClockStopMode(huart);
#endif
HAL_UARTEx_EnableStopMode(huart);
} else {
HAL_UARTEx_DisableClockStopMode(huart);