Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit348fdc4

Browse files
angelnufpistm
andauthored
Use more efficient mode for STM32L4XX stop mode (#1097)
Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
1 parent469a95f commit348fdc4

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

‎libraries/SrcWrapper/src/stm32/low_power.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,24 @@ void LowPower_stop(serial_t *obj)
223223
HAL_PWREx_EnableFastWakeUp();
224224
#endif
225225
#ifdef__HAL_RCC_WAKEUPSTOP_CLK_CONFIG
226-
/* Select HSI as system clock source after Wake Up from Stop mode */
226+
/* Select MSI or HSI as system clock source after Wake Up from Stop mode */
227+
#ifdefRCC_STOP_WAKEUPCLOCK_MSI
228+
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_MSI);
229+
#else
227230
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_HSI);
231+
#endif
228232
#endif
229233

230234
/* Enter Stop mode */
231-
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI);
235+
#if defined(STM32L4xx)
236+
if ((WakeUpUart==NULL)|| (WakeUpUart->Instance== (USART_TypeDef*)LPUART1_BASE)) {
237+
// STM32L4xx supports STOP2 mode which halves consumption
238+
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
239+
}else
240+
#endif
241+
{
242+
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI);
243+
}
232244

233245
/* Exit Stop mode reset clocks */
234246
SystemClock_ConfigFromStop();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp