You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#defineFILE_AN_ISSUE translate("\r\nPlease file an issue with the contents of your CIRCUITPY drive at \nhttps://github.com/adafruit/circuitpython/issues\r\n")
100
+
97
101
voidprint_safe_mode_message(safe_mode_treason) {
98
102
if (reason==NO_SAFE_MODE) {
99
103
return;
100
104
}
101
105
serial_write("\r\n");
102
-
// Output a user safe mode string if its set.
106
+
// Output a user safe mode string if it's set.
103
107
#ifdefBOARD_USER_SAFE_MODE
104
108
if (reason==USER_SAFE_MODE) {
105
109
serial_write_compressed(translate("You requested starting safe mode by "));
106
110
serial_write(BOARD_USER_SAFE_MODE_ACTION);
107
-
serial_write("\r\n");
108
-
serial_write_compressed(translate("To exit, please reset the board without "));
111
+
serial_write_compressed(translate("\r\nTo exit, please reset the board without "));
109
112
serial_write(BOARD_USER_SAFE_MODE_ACTION);
110
113
serial_write("\r\n");
111
114
} else
112
115
#endif
113
-
if (reason==MANUAL_SAFE_MODE) {
114
-
serial_write_compressed(translate("The reset button was pressed while booting CircuitPython. Press again to exit safe mode.\n"));
115
-
} elseif (reason==PROGRAMMATIC_SAFE_MODE) {
116
-
serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\n"));
117
-
} else {
118
-
serial_write_compressed(translate("You are running in safe mode which means something unanticipated happened.\n"));
119
-
if (reason==HARD_CRASH||reason==MICROPY_NLR_JUMP_FAIL||reason==MICROPY_FATAL_ERROR||reason==GC_ALLOC_OUTSIDE_VM) {
120
-
serial_write_compressed(translate("Looks like our core CircuitPython code crashed hard. Whoops!\nPlease file an issue at https://github.com/adafruit/circuitpython/issues\n with the contents of your CIRCUITPY drive and this message:\n"));
121
-
if (reason==HARD_CRASH) {
122
-
serial_write_compressed(translate("Crash into the HardFault_Handler.\n"));
serial_write_compressed(translate("Attempted heap allocation when MicroPython VM not running.\n"));
129
-
}
130
-
} elseif (reason==BROWNOUT) {
131
-
serial_write_compressed(translate("The microcontroller's power dipped. Please make sure your power supply provides\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\n"));
132
-
} elseif (reason==HEAP_OVERWRITTEN) {
133
-
serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\nPlease increase stack size limits and press reset (after ejecting CIRCUITPY).\nIf you didn't change the stack, then file an issue here with the contents of your CIRCUITPY drive:\n"));
serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\r\n"));
119
+
return;
120
+
casePROGRAMMATIC_SAFE_MODE:
121
+
serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\r\n"));
122
+
return;
123
+
default:
124
+
break;
135
125
}
136
-
}
126
+
127
+
serial_write_compressed(translate("You are in safe mode: something unanticipated happened.\r\n"));
128
+
switch (reason) {
129
+
caseBROWNOUT:
130
+
serial_write_compressed(translate("The microcontroller's power dipped. Make sure your power supply provides\r\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\r\n"));
131
+
return;
132
+
caseHEAP_OVERWRITTEN:
133
+
serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\r\nPlease increase the stack size if you know how, or if not:"));
0 commit comments