aboutsummaryrefslogtreecommitdiff
path: root/py/scheduler.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-02-07 12:07:50 +1100
committerDamien George <damien.p.george@gmail.com>2020-02-07 16:08:29 +1100
commit8fb5c8fdd506518ebdcca0b0628fbfb5c77c38a2 (patch)
tree475b6541f60a83adb0dde030b3fe794723e1e113 /py/scheduler.c
parenteaf30c516af87104b7fbba7fcd557d097a4951f9 (diff)
py/scheduler: Allow a port to specify attrs for mp_keyboard_interrupt.
Functions like mp_keyboard_interrupt() may need to be called from an IRQ handler and may need to be in a special memory section, so provide a generic wrapping macro for a port to do this. The macro name is chosen to be MICROPY_WRAP_<function name in uppercase> so that (in the future with more wrappers) each function could potentially be handled separately.
Diffstat (limited to 'py/scheduler.c')
-rw-r--r--py/scheduler.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/scheduler.c b/py/scheduler.c
index 250c85983..ca91e42da 100644
--- a/py/scheduler.c
+++ b/py/scheduler.c
@@ -29,7 +29,7 @@
#include "py/runtime.h"
#if MICROPY_KBD_EXCEPTION
-void mp_keyboard_interrupt(void) {
+void MICROPY_WRAP_MP_KEYBOARD_INTERRUPT(mp_keyboard_interrupt)(void) {
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) {