8000 Merge pull request #10344 from dhalbert/nordic-reset-reason-after-dee… · eightycc/circuitpython@bbefbd6 · GitHub
[go: up one dir, main page]

Skip to content

Commit bbefbd6

Browse files
authored
Merge pull request adafruit#10344 from dhalbert/nordic-reset-reason-after-deep-sleep
Nordic reset reason after deep sleep
2 parents bab214b + 86c5680 commit bbefbd6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ports/nordic/common-hal/microcontroller/__init__.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
#include "py/obj.h"
99
#include "py/runtime.h"
1010

11+
#if CIRCUITPY_ALARM
12+
#include "common-hal/alarm/__init__.h"
13+
#endif
14+
1115
#include "common-hal/microcontroller/Pin.h"
1216
#include "common-hal/microcontroller/Processor.h"
1317

@@ -78,6 +82,14 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
7882

7983
void common_hal_mcu_reset(void) {
8084
filesystem_flush();
85+
86+
// Clear any saved info about last deep sleep wakeup,
87+
// to avoid confusing this software reset with a real deep sleep reset.
88+
// See logic in common_hal_mcu_processor_get_reset_reason().
89+
#if CIRCUITPY_ALARM
90+
sleepmem_wakeup_event = SLEEPMEM_WAKEUP_BY_NONE;
91+
#endif
92+
8193
reset_cpu();
8294
}
8395

0 commit comments

Comments
 (0)
0