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).
This commit is contained in:
parent
f334816df0
commit
4d8504425a
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue