diff options
author | Damien George <damien.p.george@gmail.com> | 2016-12-15 13:00:19 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-12-15 13:00:19 +1100 |
commit | 7f1da0a03b1559080ca4d054bd38f104bde168e6 (patch) | |
tree | 1450845231e9bda2a481a67140cb09d6ad7ba71c /py/mpstate.h | |
parent | 979ab4e126dacca4d7fbbd0e71c849365ef2c947 (diff) |
py: Add MICROPY_KBD_EXCEPTION config option to provide mp_kbd_exception.
Defining and initialising mp_kbd_exception is boiler-plate code and so the
core runtime can provide it, instead of each port needing to do it
themselves.
The exception object is placed in the VM state rather than on the heap.
Diffstat (limited to 'py/mpstate.h')
-rw-r--r-- | py/mpstate.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpstate.h b/py/mpstate.h index 439ed6606..91fb68b3a 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -118,6 +118,11 @@ typedef struct _mp_state_vm_t { #endif #endif + #if MICROPY_KBD_EXCEPTION + // exception object of type KeyboardInterrupt + mp_obj_exception_t mp_kbd_exception; + #endif + // dictionary with loaded modules (may be exposed as sys.modules) mp_obj_dict_t mp_loaded_modules_dict; |