aboutsummaryrefslogtreecommitdiff
path: root/lib/utils/interrupt_char.c
AgeCommit message (Collapse)Author
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.