Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions atmel-samd/mphalport.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "lib/utils/interrupt_char.h"
#include "py/mphal.h"
#include "py/mpstate.h"
#include "py/runtime.h"
#include "py/smallint.h"
#include "shared-bindings/time/__init__.h"

Expand Down Expand Up @@ -157,6 +158,11 @@ int mp_hal_stdin_rx_chr(void) {
#ifdef MICROPY_VM_HOOK_LOOP
MICROPY_VM_HOOK_LOOP
#endif
// Check to see if we've been CTRL-Ced by autoreload or the user. Raise the exception if so.
if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) {
mp_handle_pending();
}

#ifdef USB_REPL
if (reload_next_character) {
return CHAR_CTRL_D;
Expand Down
3 changes: 0 additions & 3 deletions lib/utils/pyexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
} else {
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
ret = PYEXEC_EXCEPTION;
if (mp_obj_is_subclass_fast(mp_obj_get_type((mp_obj_t)nlr.ret_val), &mp_type_KeyboardInterrupt)) {
ret = PYEXEC_FORCED_EXIT;
}
}
}
if (result != NULL) {
Expand Down