summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2021-01-12 09:23:07 -0600
committerJeff Epler <jepler@gmail.com>2021-01-12 09:23:07 -0600
commit1ca29ec47c9f51589faa151b659dfd1dd4a349ef (patch)
tree0a2e35b45a52e85f258cc522615e37965b0453d3 /py
parente20c65d8f044cb9522cd1a7f4a3030efefa77cbb (diff)
parent047708e36e67beee14771120296cdf758f00601d (diff)
Merge remote-tracking branch 'origin/main' into audioout-esp32
Diffstat (limited to 'py')
-rw-r--r--py/circuitpy_defns.mk14
-rw-r--r--py/circuitpy_mpconfig.h8
-rw-r--r--py/circuitpy_mpconfig.mk3
3 files changed, 25 insertions, 0 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
index d6d192a95..21bd5b965 100644
--- a/py/circuitpy_defns.mk
+++ b/py/circuitpy_defns.mk
@@ -58,6 +58,14 @@ BASE_CFLAGS = \
# -H
+# Set a global CIRCUITPY_DEBUG flag.
+# Don't just call it "DEBUG": too many libraries use plain DEBUG.
+ifneq ($(DEBUG),)
+CFLAGS += -DCIRCUITPY_DEBUG=$(DEBUG)
+else
+CFLAGS += -DCIRCUITPY_DEBUG=0
+endif
+
###
# Handle frozen modules.
@@ -292,6 +300,9 @@ endif
ifeq ($(CIRCUITPY_PEW),1)
SRC_PATTERNS += _pew/%
endif
+ifeq ($(CIRCUITPY_MSGPACK),1)
+SRC_PATTERNS += msgpack/%
+endif
# All possible sources are listed here, and are filtered by SRC_PATTERNS in SRC_COMMON_HAL
SRC_COMMON_HAL_ALL = \
@@ -412,6 +423,8 @@ $(filter $(SRC_PATTERNS), \
math/__init__.c \
microcontroller/ResetReason.c \
microcontroller/RunMode.c \
+ msgpack/__init__.c \
+ msgpack/ExtType.c \
supervisor/RunReason.c \
)
@@ -481,6 +494,7 @@ SRC_SHARED_MODULE_ALL = \
memorymonitor/AllocationAlarm.c \
memorymonitor/AllocationSize.c \
network/__init__.c \
+ msgpack/__init__.c \
os/__init__.c \
random/__init__.c \
rgbmatrix/RGBMatrix.c \
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h
index 08c92a77e..a3411b7ad 100644
--- a/py/circuitpy_mpconfig.h
+++ b/py/circuitpy_mpconfig.h
@@ -774,6 +774,13 @@ extern const struct _mp_obj_module_t wifi_module;
#define WIFI_MODULE
#endif
+#if CIRCUITPY_MSGPACK
+extern const struct _mp_obj_module_t msgpack_module;
+#define MSGPACK_MODULE { MP_ROM_QSTR(MP_QSTR_msgpack), MP_ROM_PTR(&msgpack_module) },
+#else
+#define MSGPACK_MODULE
+#endif
+
// Define certain native modules with weak links so they can be replaced with Python
// implementations. This list may grow over time.
#define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \
@@ -830,6 +837,7 @@ extern const struct _mp_obj_module_t wifi_module;
_EVE_MODULE \
MEMORYMONITOR_MODULE \
MICROCONTROLLER_MODULE \
+ MSGPACK_MODULE \
NEOPIXEL_WRITE_MODULE \
NETWORK_MODULE \
SOCKET_MODULE \
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk
index 9a07f62a3..d0145a90f 100644
--- a/py/circuitpy_mpconfig.mk
+++ b/py/circuitpy_mpconfig.mk
@@ -312,3 +312,6 @@ CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI)
# Enabled micropython.native decorator (experimental)
CIRCUITPY_ENABLE_MPY_NATIVE ?= 0
CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE)
+
+CIRCUITPY_MSGPACK ?= $(CIRCUITPY_FULL_BUILD)
+CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK)