8000 nordic: don't confuse microcontroller.reset() with deep sleep wakeup · adafruit/circuitpython@e7e6fa4 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7e6fa4

Browse files
committed
nordic: don't confuse microcontroller.reset() with deep sleep wakeup
1 parent d52beb2 commit e7e6fa4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

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

11+
#include "common-hal/alarm/__init__.h"
1112
#include "common-hal/microcontroller/Pin.h"
1213
#include "common-hal/microcontroller/Processor.h"
1314

@@ -78,6 +79,12 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
7879

7980
void common_hal_mcu_reset(void) {
8081
filesystem_flush();
82+
83+
// Clear any saved info about last deep sleep wakeup,
84+
// to avoid confusing this software reset with a real deep sleep reset.
85+
// See logic in common_hal_mcu_processor_get_reset_reason().
86+
sleepmem_wakeup_event = SLEEPMEM_WAKEUP_BY_NONE;
87+
8188
reset_cpu();
8289
}
8390

0 commit comments

Comments
 (0)
0