summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2021-01-20 18:40:53 -0800
committerScott Shawcroft <scott@tannewt.org>2021-01-20 19:16:56 -0800
commitfb1e0106b51a03007eae71cc8489b85d1cdb9bda (patch)
tree704e1b5e6fd9c008536a41a9e9f4a53347c193e9 /main.c
parent48721584f95ec881ca62ace00b02323d9c38096c (diff)
Fix press any key message
Diffstat (limited to 'main.c')
-rwxr-xr-xmain.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/main.c b/main.c
index 91b6a062d..d9cdcca1d 100755
--- a/main.c
+++ b/main.c
@@ -317,7 +317,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
// Program has finished running.
- bool serial_connected_before_animation = serial_connected();
+ bool printed_press_any_key = false;
#if CIRCUITPY_DISPLAYIO
bool refreshed_epaper_display = false;
#endif
@@ -364,7 +364,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
}
#endif
- if (!serial_connected_before_animation && serial_connected()) {
+ if (!printed_press_any_key && serial_connected()) {
if (!serial_connected_at_start) {
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);
serial_write("\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;
+ 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.
#if CIRCUITPY_DISPLAYIO