Browse Source

lib/utils/interrupt_char: Invalidate interrupt char at start up.

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.
pull/4731/head
Damien George 6 years ago
parent
commit
2459162599
  1. 2
      lib/utils/interrupt_char.c

2
lib/utils/interrupt_char.c

@ -29,7 +29,7 @@
#if MICROPY_KBD_EXCEPTION
int mp_interrupt_char;
int mp_interrupt_char = -1;
void mp_hal_set_interrupt_char(int c) {
if (c != -1) {

Loading…
Cancel
Save