diff options
author | Damien George <damien.p.george@gmail.com> | 2015-03-22 17:55:50 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-03-22 17:55:50 +0000 |
commit | f44ace11fb263639dfe938456dbd2e56212dbec8 (patch) | |
tree | b50be3559a48be7b3ca1b34479add8612f9792e3 /stmhal/modpyb.c | |
parent | 104a86744759cb635ad9a32830de9e1452da60c4 (diff) |
stmhal: Put flash in deep power-down mode when entering stop mode.
This can get PYBv1.0 stop current down to around 290uA.
Diffstat (limited to 'stmhal/modpyb.c')
-rw-r--r-- | stmhal/modpyb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c index c71d3e77e..2e4642fad 100644 --- a/stmhal/modpyb.c +++ b/stmhal/modpyb.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 |