stm32/powerctrl: Add pre/post stop mode entry macros.

These allow a board to perform actions before/after stop mode.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader 2024-09-19 13:54:39 +02:00 committed by Damien George
parent eec5eb4260
commit 3a2252b4c2

View File

@ -827,12 +827,20 @@ void powerctrl_enter_stop_mode(void) {
powerctrl_low_power_prep_wb55();
#endif
#if defined(MICROPY_BOARD_PRE_STOP)
MICROPY_BOARD_PRE_STOP
#endif
#if defined(STM32F7)
HAL_PWR_EnterSTOPMode((PWR_CR1_LPDS | PWR_CR1_LPUDS | PWR_CR1_FPDS | PWR_CR1_UDEN), PWR_STOPENTRY_WFI);
#else
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
#endif
#if defined(MICROPY_BOARD_POST_STOP)
MICROPY_BOARD_POST_STOP
#endif
// reconfigure the system clock after waking up
#if defined(STM32F0)