mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 12:10:13 +01:00
shared/runtime/pyexec: Call mp_hal_stdio_mode_orig/raw as appropriate.
This ensures that ctrl-C works on the unix port when executing code at the REPL. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -193,7 +193,6 @@ static int do_repl(void) {
|
||||
// use MicroPython supplied readline-based REPL
|
||||
|
||||
int ret = 0;
|
||||
mp_hal_stdio_mode_raw();
|
||||
for (;;) {
|
||||
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) {
|
||||
if ((ret = pyexec_raw_repl()) != 0) {
|
||||
@@ -205,7 +204,6 @@ static int do_repl(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
mp_hal_stdio_mode_orig();
|
||||
return ret;
|
||||
|
||||
#else
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
MP_THREAD_GIL_ENTER(); \
|
||||
} while (0)
|
||||
|
||||
// The port provides `mp_hal_stdio_mode_raw()` and `mp_hal_stdio_mode_orig()`.
|
||||
#define MICROPY_HAL_HAS_STDIO_MODE_SWITCH (1)
|
||||
|
||||
void mp_hal_set_interrupt_char(char c);
|
||||
|
||||
#define mp_hal_stdio_poll unused // this is not implemented, nor needed
|
||||
|
||||
Reference in New Issue
Block a user