summaryrefslogtreecommitdiff
path: root/lib/utils/interrupt_char.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-05-01 12:41:07 +1000
committerDamien George <damien.p.george@gmail.com>2019-05-01 12:41:07 +1000
commit245916259926777b1b157c679785597572576f57 (patch)
treee38cd294b21c01f5e711a8ddb97ea7546f1d5bd6 /lib/utils/interrupt_char.c
parent859596ce25bcaa9b6104f16b8b55d0832c55e3f8 (diff)
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.
Diffstat (limited to 'lib/utils/interrupt_char.c')
-rw-r--r--lib/utils/interrupt_char.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/interrupt_char.c b/lib/utils/interrupt_char.c
index fca0f95b5..43d45e5ae 100644
--- a/lib/utils/interrupt_char.c
+++ b/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) {