summaryrefslogtreecommitdiff
path: root/lib/utils/interrupt_char.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2018-08-17 16:51:45 -0700
committerGitHub <noreply@github.com>2018-08-17 16:51:45 -0700
commit4a4d84ba42fb84032b31344e14fc3bb1f9e8dce2 (patch)
treeed2e486dea85dd416975d30e6beca608ce5597bc /lib/utils/interrupt_char.c
parent5dd420f7ff2c87a5412a55fea29eb21615a89e14 (diff)
parent11cbeb87adb10883fe46c46bd4e22e3ad3991ed3 (diff)
Merge pull request #1064 from notro/i2cslave
Add busio.I2CSlave
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