mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user