summaryrefslogtreecommitdiff
path: root/lib/utils/interrupt_char.c
AgeCommit message (Collapse)Author
2021-07-12shared: Introduce new top-level dir and move 1st party lib code there.Damien George
This commit moves all first-party code developed for this project from lib/ to shared/, so that lib/ now only contains third-party code. The following directories are moved as-is from lib to shared: lib/libc -> shared/libc lib/memzip -> shared/memzip lib/netutils -> shared/netutils lib/timeutils -> shared/timeutils lib/upytesthelper -> shared/upytesthelper All files in lib/embed/ have been moved to shared/libc/. lib/mp-readline has been moved to shared/readline. lib/utils has been moved to shared/runtime, with the exception of lib/utils/printf.c which has been moved to shared/libc/printf.c. Signed-off-by: Damien George <damien@micropython.org>
2020-02-07py/scheduler: Move clearing of kbd traceback to mp_keyboard_interrupt.Damien George
This is a more logical place to clear the KeyboardInterrupt traceback, right before it is set as a pending exception. The clearing is also optimised from a function call to a simple store of NULL.
2020-02-07py/scheduler: Move mp_keyboard_interrupt from lib/utils to py core.Damien George
This function is tightly coupled to the state and behaviour of the scheduler, and is a core part of the runtime: to schedule a pending exception. So move it there.
2019-05-01lib/utils/interrupt_char: Invalidate interrupt char at start up.Damien George
Otherwise mp_interrupt_char will have a value of zero on start up (because it's in the BSS) and a KeyboardInterrupt may be raised during start up. For example this can occur if there is a UART attached to the REPL which sends spurious null bytes when the device turns on.
2017-06-02lib/utils/interrupt_char: Remove support for KBD_EXCEPTION disabled.Damien George
If a port is using interrupt_char.c then it must enable MICROPY_KBD_EXCEPTION. This is the case for all official ports.
2017-03-20py: Add micropython.schedule() function and associated runtime code.Damien George
2016-12-15lib/utils/interrupt_char: Use core-provided mp_kbd_exception if enabled.Damien George
Ultimately all ports that use lib/utils/interrupt_char would enable MICROPY_KBD_EXCEPTION, so this is an interim solution.
2016-09-29lib/interrupt_char: Factor out typical Ctrl+C handling from esp8266 port.Paul Sokolovsky
Utility functions for keyboard interrupt handling, to be reused across (baremetal) ports.