Fix it with simulate_reset instead
This commit is contained in:
parent
5bca86b43d
commit
4c9044a0bf
5
main.c
5
main.c
|
@ -1078,17 +1078,16 @@ int __attribute__((used)) main(void) {
|
||||||
int exit_code = PYEXEC_FORCED_EXIT;
|
int exit_code = PYEXEC_FORCED_EXIT;
|
||||||
bool skip_repl = true;
|
bool skip_repl = true;
|
||||||
bool simulate_reset = true;
|
bool simulate_reset = true;
|
||||||
bool first_run = true;
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!skip_repl) {
|
if (!skip_repl) {
|
||||||
exit_code = run_repl(get_safe_mode());
|
exit_code = run_repl(get_safe_mode());
|
||||||
supervisor_set_run_reason(RUN_REASON_REPL_RELOAD);
|
supervisor_set_run_reason(RUN_REASON_REPL_RELOAD);
|
||||||
}
|
}
|
||||||
if (exit_code == PYEXEC_FORCED_EXIT) {
|
if (exit_code == PYEXEC_FORCED_EXIT) {
|
||||||
if (!first_run) {
|
if (!simulate_reset) {
|
||||||
serial_write_compressed(translate("soft reboot\n"));
|
serial_write_compressed(translate("soft reboot\n"));
|
||||||
}
|
}
|
||||||
first_run = false;
|
simulate_reset = false;
|
||||||
if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
|
if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
|
||||||
// If code.py did a fake deep sleep, pretend that we
|
// If code.py did a fake deep sleep, pretend that we
|
||||||
// are running code.py for the first time after a hard
|
// are running code.py for the first time after a hard
|
||||||
|
|
Loading…
Reference in New Issue