From 7f1da0a03b1559080ca4d054bd38f104bde168e6 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 15 Dec 2016 13:00:19 +1100 Subject: 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. --- py/mpconfig.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'py/mpconfig.h') diff --git a/py/mpconfig.h b/py/mpconfig.h index ea90ec984..7a71ebd95 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -446,6 +446,11 @@ # endif #endif +// Whether to provide the mp_kbd_exception object +#ifndef MICROPY_KBD_EXCEPTION +#define MICROPY_KBD_EXCEPTION (0) +#endif + // Prefer to raise KeyboardInterrupt asynchronously (from signal or interrupt // handler) - if supported by a particular port. #ifndef MICROPY_ASYNC_KBD_INTR -- cgit v1.2.3