stmhal: Put flash in deep power-down mode when entering stop mode.
This can get PYBv1.0 stop current down to around 290uA.
This commit is contained in:
parent
104a867447
commit
f44ace11fb
@ -168,6 +168,7 @@ SRC_HAL = $(addprefix $(HAL_DIR)/src/,\
|
||||
stm32f4xx_hal_pcd.c \
|
||||
stm32f4xx_hal_pcd_ex.c \
|
||||
stm32f4xx_hal_pwr.c \
|
||||
stm32f4xx_hal_pwr_ex.c \
|
||||
stm32f4xx_hal_rcc.c \
|
||||
stm32f4xx_hal_rcc_ex.c \
|
||||
stm32f4xx_hal_rng.c \
|
||||
|
@ -425,6 +425,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_udelay_obj, pyb_udelay);
|
||||
|
||||
/// \function stop()
|
||||
STATIC mp_obj_t pyb_stop(void) {
|
||||
// takes longer to wake but reduces stop current
|
||||
HAL_PWREx_EnableFlashPowerDown();
|
||||
|
||||
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
|
||||
|
||||
// reconfigure the system clock after waking up
|
||||
|
Loading…
x
Reference in New Issue
Block a user