From 0c59c30fdeba4479817fe8cf3e5f0e4345a0d927 Mon Sep 17 00:00:00 2001
From: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Date: Fri, 16 Dec 2016 01:07:28 +0300
Subject: [PATCH] zephyr: Use core-provided keyboard exception object.

---
 zephyr/main.c                 | 1 -
 zephyr/mpconfigport.h         | 2 +-
 zephyr/mpconfigport_minimal.h | 1 -
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/zephyr/main.c b/zephyr/main.c
index 0d381f010..2c7f3fc47 100644
--- a/zephyr/main.c
+++ b/zephyr/main.c
@@ -75,7 +75,6 @@ soft_reset:
     mp_obj_list_init(mp_sys_path, 0);
     mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script)
     mp_obj_list_init(mp_sys_argv, 0);
-    MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
 
     #if MICROPY_MODULE_FROZEN
     pyexec_frozen_module("main.py");
diff --git a/zephyr/mpconfigport.h b/zephyr/mpconfigport.h
index e291faf1d..64cf206be 100644
--- a/zephyr/mpconfigport.h
+++ b/zephyr/mpconfigport.h
@@ -37,6 +37,7 @@
 #define MICROPY_ENABLE_GC           (1)
 #define MICROPY_HELPER_REPL         (1)
 #define MICROPY_REPL_AUTO_INDENT    (1)
+#define MICROPY_KBD_EXCEPTION       (1)
 #define MICROPY_CPYTHON_COMPAT      (0)
 #define MICROPY_PY_ASYNC_AWAIT      (0)
 #define MICROPY_PY_ATTRTUPLE        (0)
@@ -94,7 +95,6 @@ typedef long mp_off_t;
 #define MP_STATE_PORT MP_STATE_VM
 
 #define MICROPY_PORT_ROOT_POINTERS \
-    mp_obj_t mp_kbd_exception; \
     const char *readline_hist[8];
 
 extern const struct _mp_obj_module_t mp_module_machine;
diff --git a/zephyr/mpconfigport_minimal.h b/zephyr/mpconfigport_minimal.h
index 6629ffe9c..4ecc03afb 100644
--- a/zephyr/mpconfigport_minimal.h
+++ b/zephyr/mpconfigport_minimal.h
@@ -87,5 +87,4 @@ typedef long mp_off_t;
 #define MP_STATE_PORT MP_STATE_VM
 
 #define MICROPY_PORT_ROOT_POINTERS \
-    mp_obj_t mp_kbd_exception; \
     const char *readline_hist[8];
-- 
GitLab