You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
stmhal/modmachine: Fix clearing of reset-cause flags.
To reset the flags we should write to the single bit only, not the entire register (otherwise all other settings in the register are cleared). Fixes #2457.
This commit is contained in:
+2
-2
@@ -68,7 +68,7 @@ void machine_init(void) {
|
||||
if (PWR->CSR & PWR_CSR_SBF) {
|
||||
// came out of standby
|
||||
reset_cause = PYB_RESET_DEEPSLEEP;
|
||||
PWR->CR = PWR_CR_CSBF;
|
||||
PWR->CR |= PWR_CR_CSBF;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@@ -86,7 +86,7 @@ void machine_init(void) {
|
||||
}
|
||||
}
|
||||
// clear RCC reset flags
|
||||
RCC->CSR = RCC_CSR_RMVF;
|
||||
RCC->CSR |= RCC_CSR_RMVF;
|
||||
}
|
||||
|
||||
// machine.info([dump_alloc_table])
|
||||
|
||||
Reference in New Issue
Block a user