summaryrefslogtreecommitdiff
path: root/ports/stm32/powerctrl.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2023-11-24 18:25:30 +1100
committerDamien George <damien@micropython.org>2023-11-30 16:11:11 +1100
commite1ec6af654b1c5c4a973b6c6b029ee68bb92eb89 (patch)
treebe9ca3b41d2fa993a7af4c3694ebbb63a05d4713 /ports/stm32/powerctrl.c
parent48b5a7b06079f0d0aa4780016f015ff023875680 (diff)
extmod/modmachine: Provide common bindings for 6 bare-metal functions.
Minor changes for consistency are: - nrf gains: unique_id(), freq() [they do nothing] - samd: deepsleep() now resets after calling lightsleep() - esp32: lightsleep()/deepsleep() no longer take kw arg "sleep", instead it's positional to match others. also, passing 0 here will now do a 0ms sleep instead of acting like nothing was passed. reset_cause() no longer takes any args (before it would just ignore them) - mimxrt: freq() with an argument and lightsleep() both raise NotImplementedError Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'ports/stm32/powerctrl.c')
-rw-r--r--ports/stm32/powerctrl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ports/stm32/powerctrl.c b/ports/stm32/powerctrl.c
index 1bb66c978..712021edb 100644
--- a/ports/stm32/powerctrl.c
+++ b/ports/stm32/powerctrl.c
@@ -993,7 +993,7 @@ void powerctrl_enter_stop_mode(void) {
enable_irq(irq_state);
}
-void powerctrl_enter_standby_mode(void) {
+NORETURN void powerctrl_enter_standby_mode(void) {
rtc_init_finalise();
#if defined(MICROPY_BOARD_ENTER_STANDBY)
@@ -1114,5 +1114,7 @@ void powerctrl_enter_standby_mode(void) {
// enter standby mode
HAL_PWR_EnterSTANDBYMode();
- // we never return; MCU is reset on exit from standby
+
+ // MCU is reset on exit from standby, but just in case it's not, do an explicit reset.
+ powerctrl_mcu_reset();
}