diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-12-23 00:06:37 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-12-23 00:07:00 +0200 |
commit | 1c9210bc2b58303c1df2ff287f17d178b1a2772b (patch) | |
tree | fb38fd67839a5738b43ca2a73a87a28938f2df8e /py/mpconfig.h | |
parent | e9751d2ac057070c52a7a67bd6e8b97e944ee088 (diff) |
unix/unix_mphal: Raise KeyboardInterrupt straight from signal handler.
POSIX doesn't guarantee something like that to work, but it works on any
system with careful signal implementation. Roughly, the requirement is
that signal handler is executed in the context of the process, its main
thread, etc. This is true for Linux. Also tested to work without issues
on MacOSX.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 6de184a9c..5e717ad0f 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -371,6 +371,12 @@ # endif #endif +// Prefer to raise KeyboardInterrupt asynchronously (from signal or interrupt +// handler) - if supported by a particular port. +#ifndef MICROPY_ASYNC_KBD_INTR +#define MICROPY_ASYNC_KBD_INTR (0) +#endif + // Whether to include REPL helper function #ifndef MICROPY_HELPER_REPL #define MICROPY_HELPER_REPL (0) |