From e4baefc593941f064267ee51fd0d0572b9a3fee8 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Mon, 30 Aug 2021 23:05:00 +0200 Subject: [PATCH] Add a flag to skip waiting for safe mode Sometimes we don't want the delay in the device's startup. I used a simple flag, but now it also occurs to me that we could instead make the wait time a define, and set it to 0 to disable it. --- frozen/circuitpython-stage | 2 +- supervisor/shared/safe_mode.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 275c03e340..d0f1c46d7f 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 275c03e340c3853ab1c53fc15b6df07ceb672bdc +Subproject commit d0f1c46d7f879cd60562ee69900d619499d4d206 diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 2e78ef4924..646467ce39 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -66,6 +66,9 @@ safe_mode_t wait_for_safe_mode_reset(void) { reset_reason != RESET_REASON_SOFTWARE) { return NO_SAFE_MODE; } + #ifdef CIRCUITPY_SKIP_SAFE_MODE_WAIT + return NO_SAFE_MODE; + #endif port_set_saved_word(SAFE_MODE_DATA_GUARD | (MANUAL_SAFE_MODE << 8)); // Wait for a while to allow for reset.