diff options
| author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2022-02-23 09:37:48 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-03-30 15:56:26 +1100 |
| commit | a41bc5a7cadb5bea9b7800286b2f4ea4f9b26e1a (patch) | |
| tree | f76e54d5e05a1b6aaab2924aa33a5e9213f58c94 | |
| parent | 6b23f7d3011ce89aeb00bc510eba97e5e36cd180 (diff) | |
stm32/modmachine: Add deepsleep support to reset_cause() for WB55.
| -rw-r--r-- | ports/stm32/modmachine.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ports/stm32/modmachine.c b/ports/stm32/modmachine.c index 57b8ef5e6..0239ea64c 100644 --- a/ports/stm32/modmachine.c +++ b/ports/stm32/modmachine.c @@ -119,6 +119,12 @@ void machine_init(void) { reset_cause = PYB_RESET_DEEPSLEEP; PWR->SCR |= PWR_SCR_CSBF; } else + #elif defined(STM32WB) + if (PWR->EXTSCR & PWR_EXTSCR_C1SBF) { + // came out of standby + reset_cause = PYB_RESET_DEEPSLEEP; + PWR->EXTSCR |= PWR_EXTSCR_C1CSSF; + } else #endif { // get reset cause from RCC flags |
