summaryrefslogtreecommitdiff
path: root/lib/utils/interrupt_char.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/interrupt_char.c')
-rw-r--r--lib/utils/interrupt_char.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/utils/interrupt_char.c b/lib/utils/interrupt_char.c
index fca0f95b5..91ee5c80e 100644
--- a/lib/utils/interrupt_char.c
+++ b/lib/utils/interrupt_char.c
@@ -47,4 +47,9 @@ void mp_keyboard_interrupt(void) {
#endif
}
+// Check to see if we've been CTRL-C'ed by autoreload or the user.
+bool mp_hal_is_interrupted(void) {
+ return MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
+}
+
#endif