Skip to content
Snippets Groups Projects
Commit 4d850442 authored by roland's avatar roland Committed by Damien George
Browse files

stm32/modmachine: Fix reset_cause to correctly give DEEPSLEEP on L4 MCU.

Before this fix it returned SOFT_RESET after waking from a deepsleep
(standby).
parent f334816d
Branches
No related tags found
No related merge requests found
...@@ -105,6 +105,12 @@ void machine_init(void) { ...@@ -105,6 +105,12 @@ void machine_init(void) {
reset_cause = PYB_RESET_DEEPSLEEP; reset_cause = PYB_RESET_DEEPSLEEP;
PWR->CPUCR |= PWR_CPUCR_CSSF; PWR->CPUCR |= PWR_CPUCR_CSSF;
} else } else
#elif defined(STM32L4)
if (PWR->SR1 & PWR_SR1_SBF) {
// came out of standby
reset_cause = PYB_RESET_DEEPSLEEP;
PWR->SCR |= PWR_SCR_CSBF;
} else
#endif #endif
{ {
// get reset cause from RCC flags // get reset cause from RCC flags
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment