summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-09-27 15:49:35 +1000
committerDamien George <damien.p.george@gmail.com>2016-09-27 15:49:35 +1000
commit88ca7ff5657aa6328f394a099cf52a76707ae943 (patch)
treee9a150f69217e1bf01ff801d2fe3c0643cce05bd
parent7385b018edaca5c8cbbd1b2d8a6a10a63d93150d (diff)
downloadmicropython-88ca7ff5657aa6328f394a099cf52a76707ae943.tar.gz
micropython-88ca7ff5657aa6328f394a099cf52a76707ae943.zip
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.
-rw-r--r--stmhal/modmachine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stmhal/modmachine.c b/stmhal/modmachine.c
index c5f33146f7..cc5ae3499b 100644
--- a/stmhal/modmachine.c
+++ b/stmhal/modmachine.c
@@ -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])