mirror of https://github.com/ARMmbed/mbed-os.git
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/8479/head
parent
abd5f21b73
commit
f427af229d
|
@ -536,7 +536,9 @@ HAL_StatusTypeDef init_uart(serial_t *obj)
|
||||||
#if defined(LPUART1_BASE)
|
#if defined(LPUART1_BASE)
|
||||||
if (huart->Instance == LPUART1) {
|
if (huart->Instance == LPUART1) {
|
||||||
if (obj_s->baudrate <= 9600) {
|
if (obj_s->baudrate <= 9600) {
|
||||||
|
#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE)
|
||||||
HAL_UARTEx_EnableClockStopMode(huart);
|
HAL_UARTEx_EnableClockStopMode(huart);
|
||||||
|
#endif
|
||||||
HAL_UARTEx_EnableStopMode(huart);
|
HAL_UARTEx_EnableStopMode(huart);
|
||||||
} else {
|
} else {
|
||||||
HAL_UARTEx_DisableClockStopMode(huart);
|
HAL_UARTEx_DisableClockStopMode(huart);
|
||||||
|
|
Loading…
Reference in New Issue