Skip to content

Commit a1bfa56

Browse files
FRASTMfpistm
authored andcommitted
[L5] support the stm32L5 soc with low power modes
Signed-off-by: Francois Ramu <[email protected]>
1 parent ea16380 commit a1bfa56

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/STM32LowPower.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ void STM32LowPower::programRtcWakeUp(uint32_t ms, LP_Mode lp_mode)
188188
break;
189189
default:
190190
case SHUTDOWN_MODE:
191-
#ifdef STM32L4xx
192-
// For shutdown mode LSE have to be used (STM32L4 series only)
191+
#if defined(STM32L4xx) || defined(STM32L5xx)
192+
// For shutdown mode LSE have to be used (STM32L4 or STM32L5 series only)
193193
clkSrc = STM32RTC::LSE_CLOCK;
194194
#else
195195
// LSE or LSI

src/low_power.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void LowPower_stop(serial_t *obj)
231231
#endif
232232

233233
/* Enter Stop mode */
234-
#if defined(STM32L4xx)
234+
#if defined(STM32L4xx) || defined(STM32L5xx)
235235
if ((WakeUpUart == NULL) || (WakeUpUart->Instance == (USART_TypeDef *)LPUART1_BASE)) {
236236
// STM32L4xx supports STOP2 mode which halves consumption
237237
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
@@ -290,7 +290,7 @@ void LowPower_standby()
290290
void LowPower_shutdown()
291291
{
292292
__disable_irq();
293-
#ifdef STM32L4xx
293+
#if defined(STM32L4xx) || defined(STM32L5xx)
294294
/* LSE must be on to use shutdown mode */
295295
if (__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == SET) {
296296
HAL_PWREx_EnterSHUTDOWNMode();

0 commit comments

Comments
 (0)