From 5e38bb98cbcc2d1ab607b19d11e628def4f48f4c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 10 Oct 2020 14:30:37 -0500 Subject: [PATCH] rgbmatrix: update protomatter to 1.0.5 tag this is compile-tested on stm32f405 feather matrixportal nrf52840 feather but not actually tested-tested. --- lib/protomatter | 2 +- py/circuitpy_defns.mk | 4 ++-- shared-bindings/rgbmatrix/RGBMatrix.h | 2 +- shared-module/rgbmatrix/RGBMatrix.c | 12 ++++++------ shared-module/rgbmatrix/RGBMatrix.h | 2 +- shared-module/rgbmatrix/allocator.h | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/protomatter b/lib/protomatter index 5f07ec6188..de6b7704c5 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 5f07ec6188852794a94138763e612844842f13e4 +Subproject commit de6b7704c530d886ad8dfa0fa1864764d86117ee diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 76c0a4db67..525e0b2bf2 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -528,10 +528,10 @@ 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_RGBMATRIX),1) -SRC_MOD += $(addprefix lib/protomatter/, \ +SRC_MOD += $(addprefix lib/protomatter/src/, \ core.c \ ) -$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces +$(BUILD)/lib/protomatter/src/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces endif # All possible sources are listed here, and are filtered by SRC_PATTERNS. diff --git a/shared-bindings/rgbmatrix/RGBMatrix.h b/shared-bindings/rgbmatrix/RGBMatrix.h index 1dc5a406ca..bfe37c3404 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.h +++ b/shared-bindings/rgbmatrix/RGBMatrix.h @@ -27,7 +27,7 @@ #pragma once #include "shared-module/rgbmatrix/RGBMatrix.h" -#include "lib/protomatter/core.h" +#include "lib/protomatter/src/core.h" extern const mp_obj_type_t rgbmatrix_RGBMatrix_type; diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 3007ca4db5..a775181309 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -78,10 +78,10 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, // verify that the matrix is big enough mp_get_index(mp_obj_get_type(self->framebuffer), self->bufinfo.len, MP_OBJ_NEW_SMALL_INT(self->bufsize-1), false); } else { - _PM_FREE(self->bufinfo.buf); - _PM_FREE(self->protomatter.rgbPins); - _PM_FREE(self->protomatter.addr); - _PM_FREE(self->protomatter.screenData); + _PM_free(self->bufinfo.buf); + _PM_free(self->protomatter.rgbPins); + _PM_free(self->protomatter.addr); + _PM_free(self->protomatter.screenData); self->framebuffer = NULL; self->bufinfo.buf = common_hal_rgbmatrix_allocator_impl(self->bufsize); @@ -164,13 +164,13 @@ void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t* self) { free_pin(&self->oe_pin); if (self->protomatter.rgbPins) { - _PM_free(&self->protomatter); + _PM_deallocate(&self->protomatter); } memset(&self->protomatter, 0, sizeof(self->protomatter)); // If it was supervisor-allocated, it is supervisor-freed and the pointer // is zeroed, otherwise the pointer is just zeroed - _PM_FREE(self->bufinfo.buf); + _PM_free(self->bufinfo.buf); self->base.type = NULL; // If a framebuffer was passed in to the constructor, NULL the reference diff --git a/shared-module/rgbmatrix/RGBMatrix.h b/shared-module/rgbmatrix/RGBMatrix.h index 19d7d5f2e7..6dbc6fd41e 100644 --- a/shared-module/rgbmatrix/RGBMatrix.h +++ b/shared-module/rgbmatrix/RGBMatrix.h @@ -26,7 +26,7 @@ #pragma once -#include "lib/protomatter/core.h" +#include "lib/protomatter/src/core.h" extern const mp_obj_type_t rgbmatrix_RGBMatrix_type; typedef struct { diff --git a/shared-module/rgbmatrix/allocator.h b/shared-module/rgbmatrix/allocator.h index 323fa5ec06..3431046d5b 100644 --- a/shared-module/rgbmatrix/allocator.h +++ b/shared-module/rgbmatrix/allocator.h @@ -31,7 +31,7 @@ #include "py/misc.h" #include "supervisor/memory.h" -#define _PM_ALLOCATOR common_hal_rgbmatrix_allocator_impl -#define _PM_FREE(x) (common_hal_rgbmatrix_free_impl((x)), (x)=NULL, (void)0) +#define _PM_allocate common_hal_rgbmatrix_allocator_impl +#define _PM_free(x) (common_hal_rgbmatrix_free_impl((x)), (x)=NULL, (void)0) extern void *common_hal_rgbmatrix_allocator_impl(size_t sz); extern void common_hal_rgbmatrix_free_impl(void *);