8000 Add a flag to skip waiting for safe mode · adafruit/circuitpython@ca27a1c · GitHub
[go: up one dir, main page]

Skip to content

Commit ca27a1c

Browse files
committed
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.
1 parent 156dfad commit ca27a1c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

supervisor/shared/safe_mode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ safe_mode_t wait_for_safe_mode_reset(void) {
7777
common_hal_digitalio_digitalinout_construct(&boot_button, CIRCUITPY_BOOT_BUTTON);
7878
common_hal_digitalio_digitalinout_switch_to_input(&boot_button, PULL_UP);
7979
#endif
80+
#ifndef CIRCUITPY_SKIP_SAFE_MODE_WAIT
8081
uint64_t start_ticks = supervisor_ticks_ms64();
8182
uint64_t diff = 0;
8283
bool boot_in_safe_mode = false;
@@ -105,6 +106,7 @@ safe_mode_t wait_for_safe_mode_reset(void) {
105106
if (boot_in_safe_mode) {
106107
return USER_SAFE_MODE;
107108
}
109+
#endif
108110
// Restore the original state of the saved word if no reset occured during our wait period.
109111
port_set_saved_word(reset_state);
110112
return NO_SAFE_MODE;

0 commit comments

Comments
 (0)
0