From 2afaf931240ba8f24f064af08065448b851b74fb Mon Sep 17 00:00:00 2001
From: schneider <schneider@blinkenlichts.net>
Date: Fri, 31 Jan 2020 17:41:49 +0100
Subject: [PATCH] fix(mpconfig): Remove hard coded value for interrupt numbers

---
 lib/micropython/gen-qstr.sh |  1 -
 pycardium/meson.build       |  2 +-
 pycardium/mpconfigport.h    | 10 ++++++----
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/micropython/gen-qstr.sh b/lib/micropython/gen-qstr.sh
index 78ecf851..747ae3f6 100755
--- a/lib/micropython/gen-qstr.sh
+++ b/lib/micropython/gen-qstr.sh
@@ -11,7 +11,6 @@ shift 5
 
 OUTPUT_DIR="$(dirname "$OUTPUT")"
 
-
 # call gcc -E to generate qstr.i.last
 gcc -E -DNO_QSTR -I"$SOURCE_DIR/micropython" -I"$PROJECT_SRC" -I"$OUTPUT_DIR" "$@" >"$OUTPUT_DIR/qstr.i.last"
 
diff --git a/pycardium/meson.build b/pycardium/meson.build
index aa637280..3007f7b0 100644
--- a/pycardium/meson.build
+++ b/pycardium/meson.build
@@ -79,7 +79,7 @@ upy = static_library(
   micropython_additional_sources,
   micropython_extmod_sources,
   mp_headers,
-  include_directories: micropython_includes,
+  include_directories: [micropython_includes, include_directories('../epicardium')],
   c_args: '-w',
 )
 
diff --git a/pycardium/mpconfigport.h b/pycardium/mpconfigport.h
index 359bf799..03fd3d3f 100644
--- a/pycardium/mpconfigport.h
+++ b/pycardium/mpconfigport.h
@@ -1,7 +1,3 @@
-// TODO: we need this define, but the header is not found...
-//#include "epicardium/epicardium.h"
-#define EPIC_INT_NUM                    9
-
 /* Hardware Name */
 #define MICROPY_HW_BOARD_NAME "card10"
 #define MICROPY_HW_MCU_NAME "max32666"
@@ -97,6 +93,12 @@ typedef long mp_off_t;
 /* TODO: Document this */
 #define MP_STATE_PORT MP_STATE_VM
 
+#ifndef NO_QSTR
+#include "epicardium.h"
+#else
+#define EPIC_INT_NUM 1
+#endif
+
 /* For some reason, we need to define readline history manually */
 #define MICROPY_PORT_ROOT_POINTERS \
     const char *readline_hist[16]; \
-- 
GitLab