mirror of https://github.com/ARMmbed/mbed-os.git
STM32L0: Enable stop mode operation for the LPUART
parent
01660ff5ae
commit
7881e68efe
|
|
@ -525,6 +525,18 @@ HAL_StatusTypeDef init_uart(serial_t *obj)
|
||||||
huart->Init.Mode = UART_MODE_TX_RX;
|
huart->Init.Mode = UART_MODE_TX_RX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(LPUART1_BASE)
|
||||||
|
if (huart->Instance == LPUART1) {
|
||||||
|
if (obj_s->baudrate <= 9600) {
|
||||||
|
HAL_UARTEx_EnableClockStopMode(huart);
|
||||||
|
HAL_UARTEx_EnableStopMode(huart);
|
||||||
|
} else {
|
||||||
|
HAL_UARTEx_DisableClockStopMode(huart);
|
||||||
|
HAL_UARTEx_DisableStopMode(huart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return HAL_UART_Init(huart);
|
return HAL_UART_Init(huart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue