Fix press any key message

This commit is contained in:
Scott Shawcroft 2021-01-20 18:40:53 -08:00
parent 48721584f9
commit fb1e0106b5
No known key found for this signature in database
GPG Key ID: 9349BC7E64B1921E

9
main.c
View File

@ -317,7 +317,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
// Program has finished running. // Program has finished running.
bool serial_connected_before_animation = serial_connected(); bool printed_press_any_key = false;
#if CIRCUITPY_DISPLAYIO #if CIRCUITPY_DISPLAYIO
bool refreshed_epaper_display = false; bool refreshed_epaper_display = false;
#endif #endif
@ -364,7 +364,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
} }
#endif #endif
if (!serial_connected_before_animation && serial_connected()) { if (!printed_press_any_key && serial_connected()) {
if (!serial_connected_at_start) { if (!serial_connected_at_start) {
print_code_py_status_message(safe_mode); print_code_py_status_message(safe_mode);
} }
@ -372,11 +372,12 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
print_safe_mode_message(safe_mode); print_safe_mode_message(safe_mode);
serial_write("\n"); serial_write("\n");
serial_write_compressed(translate("Press any key to enter the REPL. Use CTRL-D to reload.\n")); serial_write_compressed(translate("Press any key to enter the REPL. Use CTRL-D to reload.\n"));
printed_press_any_key = true;
} }
if (serial_connected_before_animation && !serial_connected()) { if (!serial_connected()) {
serial_connected_at_start = false; serial_connected_at_start = false;
printed_press_any_key = false;
} }
serial_connected_before_animation = serial_connected();
// Refresh the ePaper display if we have one. That way it'll show an error message. // Refresh the ePaper display if we have one. That way it'll show an error message.
#if CIRCUITPY_DISPLAYIO #if CIRCUITPY_DISPLAYIO