summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorJeff Epler <jeff@adafruit.com>2020-04-14 18:55:40 -0500
committerGitHub <noreply@github.com>2020-04-14 18:55:40 -0500
commit7ed1483b89d24bb4dd44f9c4c8271c438303b9fe (patch)
tree6b138af871bea8cb57eaae23a1d6433bfe1bdece /py
parentada102dd986bb03186978579cc909da5c66772d6 (diff)
parent3c018bf7fd8142132bdd063a9c898188c825b2a7 (diff)
Merge pull request #2706 from jepler/protomatter
Protomatter: Integrate with CircuitPython
Diffstat (limited to 'py')
-rw-r--r--py/circuitpy_defns.mk18
-rw-r--r--py/circuitpy_mpconfig.h16
-rw-r--r--py/circuitpy_mpconfig.mk11
-rw-r--r--py/mkrules.mk2
4 files changed, 46 insertions, 1 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
index f84d0b5b1..b6b0cacaf 100644
--- a/py/circuitpy_defns.mk
+++ b/py/circuitpy_defns.mk
@@ -142,6 +142,9 @@ endif
ifeq ($(CIRCUITPY_DISPLAYIO),1)
SRC_PATTERNS += displayio/% terminalio/% fontio/%
endif
+ifeq ($(CIRCUITPY_FRAMEBUFFERIO),1)
+SRC_PATTERNS += framebufferio/%
+endif
ifeq ($(CIRCUITPY_FREQUENCYIO),1)
SRC_PATTERNS += frequencyio/%
endif
@@ -178,6 +181,9 @@ endif
ifeq ($(CIRCUITPY_PIXELBUF),1)
SRC_PATTERNS += _pixelbuf/%
endif
+ifeq ($(CIRCUITPY_PROTOMATTER),1)
+SRC_PATTERNS += _protomatter/%
+endif
ifeq ($(CIRCUITPY_PULSEIO),1)
SRC_PATTERNS += pulseio/%
endif
@@ -242,6 +248,8 @@ SRC_COMMON_HAL_ALL = \
_bleio/PacketBuffer.c \
_bleio/Service.c \
_bleio/UUID.c \
+ _protomatter/Protomatter.c \
+ _protomatter/__init__.c \
analogio/AnalogIn.c \
analogio/AnalogOut.c \
analogio/__init__.c \
@@ -315,6 +323,8 @@ SRC_SHARED_MODULE_ALL = \
_bleio/ScanResults.c \
_pixelbuf/PixelBuf.c \
_pixelbuf/__init__.c \
+ _protomatter/Protomatter.c \
+ _protomatter/__init__.c \
_stage/Layer.c \
_stage/Text.c \
_stage/__init__.c \
@@ -348,6 +358,8 @@ SRC_SHARED_MODULE_ALL = \
displayio/__init__.c \
fontio/BuiltinFont.c \
fontio/__init__.c \
+ framebufferio/FramebufferDisplay.c \
+ framebufferio/__init__.c \
gamepad/GamePad.c \
gamepad/__init__.c \
gamepadshift/GamePadShift.c \
@@ -401,6 +413,12 @@ SRC_MOD += $(addprefix lib/mp3/src/, \
)
$(BUILD)/lib/mp3/src/buffers.o: CFLAGS += -include "py/misc.h" -D'MPDEC_ALLOCATOR(x)=m_malloc(x,0)' -D'MPDEC_FREE(x)=m_free(x)'
endif
+ifeq ($(CIRCUITPY_PROTOMATTER),1)
+SRC_MOD += $(addprefix lib/protomatter/, \
+ core.c \
+)
+$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/_protomatter/allocator.h" -DCIRCUITPY -Wno-missing-braces
+endif
# All possible sources are listed here, and are filtered by SRC_PATTERNS.
SRC_SHARED_MODULE_INTERNAL = \
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h
index 04e191264..06289258d 100644
--- a/py/circuitpy_mpconfig.h
+++ b/py/circuitpy_mpconfig.h
@@ -345,6 +345,13 @@ extern const struct _mp_obj_module_t terminalio_module;
#define CIRCUITPY_DISPLAY_LIMIT (0)
#endif
+#if CIRCUITPY_FRAMEBUFFERIO
+extern const struct _mp_obj_module_t framebufferio_module;
+#define FRAMEBUFFERIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_framebufferio), (mp_obj_t)&framebufferio_module },
+#else
+#define FRAMEBUFFERIO_MODULE
+#endif
+
#if CIRCUITPY_FREQUENCYIO
extern const struct _mp_obj_module_t frequencyio_module;
#define FREQUENCYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_frequencyio), (mp_obj_t)&frequencyio_module },
@@ -454,6 +461,13 @@ extern const struct _mp_obj_module_t pixelbuf_module;
#define PIXELBUF_MODULE
#endif
+#if CIRCUITPY_PROTOMATTER
+extern const struct _mp_obj_module_t protomatter_module;
+#define PROTOMATTER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__protomatter),(mp_obj_t)&protomatter_module },
+#else
+#define PROTOMATTER_MODULE
+#endif
+
#if CIRCUITPY_PULSEIO
extern const struct _mp_obj_module_t pulseio_module;
#define PULSEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_pulseio), (mp_obj_t)&pulseio_module },
@@ -628,6 +642,7 @@ extern const struct _mp_obj_module_t ustack_module;
FONTIO_MODULE \
TERMINALIO_MODULE \
ERRNO_MODULE \
+ FRAMEBUFFERIO_MODULE \
FREQUENCYIO_MODULE \
GAMEPAD_MODULE \
GAMEPADSHIFT_MODULE \
@@ -643,6 +658,7 @@ extern const struct _mp_obj_module_t ustack_module;
PEW_MODULE \
PIXELBUF_MODULE \
PS2IO_MODULE \
+ PROTOMATTER_MODULE \
PULSEIO_MODULE \
RANDOM_MODULE \
RE_MODULE \
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk
index 1a375efc6..ba94f9784 100644
--- a/py/circuitpy_mpconfig.mk
+++ b/py/circuitpy_mpconfig.mk
@@ -149,6 +149,11 @@ CIRCUITPY_DISPLAYIO = $(CIRCUITPY_FULL_BUILD)
endif
CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO)
+ifndef CIRCUITPY_FRAMEBUFFERIO
+CIRCUITPY_FRAMEBUFFERIO = 0
+endif
+CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO)
+
ifndef CIRCUITPY_FREQUENCYIO
CIRCUITPY_FREQUENCYIO = $(CIRCUITPY_FULL_BUILD)
endif
@@ -210,6 +215,12 @@ CIRCUITPY_PIXELBUF = $(CIRCUITPY_FULL_BUILD)
endif
CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF)
+# Only for SAMD boards for the moment
+ifndef CIRCUITPY_PROTOMATTER
+CIRCUITPY_PROTOMATTER = 0
+endif
+CFLAGS += -DCIRCUITPY_PROTOMATTER=$(CIRCUITPY_PROTOMATTER)
+
ifndef CIRCUITPY_PULSEIO
CIRCUITPY_PULSEIO = $(CIRCUITPY_DEFAULT_BUILD)
endif
diff --git a/py/mkrules.mk b/py/mkrules.mk
index 292d25746..13a73b90e 100644
--- a/py/mkrules.mk
+++ b/py/mkrules.mk
@@ -145,7 +145,7 @@ $(PROG): $(OBJ)
# Do not pass COPT here - it's *C* compiler optimizations. For example,
# we may want to compile using Thumb, but link with non-Thumb libc.
$(Q)$(CC) -o $@ $^ $(LIB) $(LDFLAGS)
-ifndef DEBUG
+ifdef STRIP_CIRCUITPYTHON
$(Q)$(STRIP) $(STRIPFLAGS_EXTRA) $(PROG)
endif
$(Q)$(SIZE) $$(find $(BUILD) -path "$(BUILD)/build/frozen*.o") $(PROG)