| Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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.
|
|
If a port is using interrupt_char.c then it must enable
MICROPY_KBD_EXCEPTION. This is the case for all official ports.
|
|
|
|
Ultimately all ports that use lib/utils/interrupt_char would enable
MICROPY_KBD_EXCEPTION, so this is an interim solution.
|
|
Utility functions for keyboard interrupt handling, to be reused across
(baremetal) ports.
|