Don't reload or enter repl when autoreloading

A keypress while we waited for autoreload used to enter repl. Now
it won't.

Fixes #6480
This commit is contained in:
Scott Shawcroft 2022-08-11 12:23:25 -07:00
parent d645e9cad8
commit 3dc0290e56
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
1 changed files with 1 additions and 1 deletions

2
main.c
View File

@ -543,7 +543,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re
} }
// If interrupted by keyboard, return // If interrupted by keyboard, return
if (serial_connected() && serial_bytes_available()) { if (serial_connected() && serial_bytes_available() && !autoreload_pending()) {
// Skip REPL if reload was requested. // Skip REPL if reload was requested.
skip_repl = serial_read() == CHAR_CTRL_D; skip_repl = serial_read() == CHAR_CTRL_D;
if (skip_repl) { if (skip_repl) {