summaryrefslogtreecommitdiff
path: root/py/scheduler.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/scheduler.c')
-rw-r--r--py/scheduler.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/scheduler.c b/py/scheduler.c
index ca91e42da..eccd9f91b 100644
--- a/py/scheduler.c
+++ b/py/scheduler.c
@@ -29,7 +29,9 @@
#include "py/runtime.h"
#if MICROPY_KBD_EXCEPTION
+// This function may be called asynchronously at any time so only do the bare minimum.
void MICROPY_WRAP_MP_KEYBOARD_INTERRUPT(mp_keyboard_interrupt)(void) {
+ MP_STATE_VM(mp_kbd_exception).traceback_data = NULL;
MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
#if MICROPY_ENABLE_SCHEDULER
if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) {