Skip to content

Commit fb1e010

Browse files
committed
Fix press any key message
1 parent 4872158 commit fb1e010

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

main.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
317317

318318
// Program has finished running.
319319

320-
bool serial_connected_before_animation = serial_connected();
320+
bool printed_press_any_key = false;
321321
#if CIRCUITPY_DISPLAYIO
322322
bool refreshed_epaper_display = false;
323323
#endif
@@ -364,19 +364,20 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
364364
}
365365
#endif
366366

367-
if (!serial_connected_before_animation && serial_connected()) {
367+
if (!printed_press_any_key && serial_connected()) {
368368
if (!serial_connected_at_start) {
369369
print_code_py_status_message(safe_mode);
370370
}
371371

372372
print_safe_mode_message(safe_mode);
373373
serial_write("\n");
374374
serial_write_compressed(translate("Press any key to enter the REPL. Use CTRL-D to reload.\n"));
375+
printed_press_any_key = true;
375376
}
376-
if (serial_connected_before_animation && !serial_connected()) {
377+
if (!serial_connected()) {
377378
serial_connected_at_start = false;
379+
printed_press_any_key = false;
378380
}
379-
serial_connected_before_animation = serial_connected();
380381

381382
// Refresh the ePaper display if we have one. That way it'll show an error message.
382383
#if CIRCUITPY_DISPLAYIO

0 commit comments

Comments
 (0)