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).
pull/4385/head
roland 2018-12-27 18:04:00 +01:00 zatwierdzone przez Damien George
rodzic f334816df0
commit 4d8504425a
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -105,6 +105,12 @@ void machine_init(void) {
reset_cause = PYB_RESET_DEEPSLEEP;
PWR->CPUCR |= PWR_CPUCR_CSSF;
} 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
{
// get reset cause from RCC flags