Skip to content

Commit 8f82db5

Browse files
committed
define out the safe mode message if none
1 parent 0aa41fa commit 8f82db5

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

locale/circuitpython.pot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,6 +2011,10 @@ msgid ""
20112011
"exit safe mode."
20122012
msgstr ""
20132013

2014+
#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h
2015+
msgid "The central button was pressed at start up.\n"
2016+
msgstr ""
2017+
20142018
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
20152019
msgid "The left button was pressed at start up.\n"
20162020
msgstr ""
@@ -3839,10 +3843,6 @@ msgstr ""
38393843
msgid "pow() with 3 arguments requires integers"
38403844
msgstr ""
38413845

3842-
#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h
3843-
msgid "The central button was pressed at start up.\n"
3844-
msgstr ""
3845-
38463846
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
38473847
msgid "pull masks conflict with direction masks"
38483848
msgstr ""

supervisor/shared/safe_mode.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,17 @@ void print_safe_mode_message(safe_mode_t reason) {
146146

147147
switch (reason) {
148148
case USER_SAFE_MODE:
149-
#ifdef BOARD_USER_SAFE_MODE_ACTION
149+
#if defined(BOARD_USER_SAFE_MODE_ACTION)
150150
message = BOARD_USER_SAFE_MODE_ACTION;
151151
#elif defined(CIRCUITPY_BOOT_BUTTON)
152152
message = translate("The BOOT button was pressed at start up.\n");
153153
#endif
154-
if (message != NULL) {
155-
// Output a user safe mode string if it's set.
156-
serial_write_compressed(message);
157-
message = translate("To exit, please reset the board without requesting safe mode.");
158-
// The final piece is printed below.
159-
}
154+
#if defined(BOARD_USER_SAFE_MODE_ACTION) || defined(CIRCUITPY_BOOT_BUTTON)
155+
// Output a user safe mode string if it's set.
156+
serial_write_compressed(message);
157+
message = translate("To exit, please reset the board without requesting safe mode.");
158+
// The final piece is printed below.
159+
#endif
160160
break;
161161
case MANUAL_SAFE_MODE:
162162
message = translate("You pressed the reset button during boot. Press again to exit safe mode.");

0 commit comments

Comments
 (0)