Skip to content

Commit 776da88

Browse files
fpistmxC0000005
authored andcommitted
HAL_UARTEx_(Enable|Disable)ClockStopMode not always defined
Fix stm32duino#280 Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 5923419 commit 776da88

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cores/arduino/stm32/uart.c

+4
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,14 @@ void uart_init(serial_t *obj)
314314
*/
315315
if(obj->uart == LPUART1) {
316316
if (obj->baudrate <= 9600) {
317+
#if defined(USART_CR3_UCESM)
317318
HAL_UARTEx_EnableClockStopMode(huart);
319+
#endif
318320
HAL_UARTEx_EnableStopMode(huart);
319321
} else {
322+
#if defined(USART_CR3_UCESM)
320323
HAL_UARTEx_DisableClockStopMode(huart);
324+
#endif
321325
HAL_UARTEx_DisableStopMode(huart);
322326
}
323327
/* Trying default LPUART clock source */

0 commit comments

Comments
 (0)