Skip to content

Commit 1eb1434

Browse files
authored
Merge pull request #3537 from jepler/update-protomatter-2
rgbmatrix: update protomatter to 1.0.5 tag
2 parents 179e13f + 5e38bb9 commit 1eb1434

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

py/circuitpy_defns.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,10 @@ SRC_MOD += $(addprefix lib/mp3/src/, \
525525
$(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)'
526526
endif
527527
ifeq ($(CIRCUITPY_RGBMATRIX),1)
528-
SRC_MOD += $(addprefix lib/protomatter/, \
528+
SRC_MOD += $(addprefix lib/protomatter/src/, \
529529
core.c \
530530
)
531-
$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces
531+
$(BUILD)/lib/protomatter/src/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces
532532
endif
533533

534534
# All possible sources are listed here, and are filtered by SRC_PATTERNS.

shared-bindings/rgbmatrix/RGBMatrix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#pragma once
2828

2929
#include "shared-module/rgbmatrix/RGBMatrix.h"
30-
#include "lib/protomatter/core.h"
30+
#include "lib/protomatter/src/core.h"
3131

3232
extern const mp_obj_type_t rgbmatrix_RGBMatrix_type;
3333

shared-module/rgbmatrix/RGBMatrix.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self,
7878
// verify that the matrix is big enough
7979
mp_get_index(mp_obj_get_type(self->framebuffer), self->bufinfo.len, MP_OBJ_NEW_SMALL_INT(self->bufsize-1), false);
8080
} else {
81-
_PM_FREE(self->bufinfo.buf);
82-
_PM_FREE(self->protomatter.rgbPins);
83-
_PM_FREE(self->protomatter.addr);
84-
_PM_FREE(self->protomatter.screenData);
81+
_PM_free(self->bufinfo.buf);
82+
_PM_free(self->protomatter.rgbPins);
83+
_PM_free(self->protomatter.addr);
84+
_PM_free(self->protomatter.screenData);
8585

8686
self->framebuffer = NULL;
8787
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) {
164164
free_pin(&self->oe_pin);
165165

166166
if (self->protomatter.rgbPins) {
167-
_PM_free(&self->protomatter);
167+
_PM_deallocate(&self->protomatter);
168168
}
169169
memset(&self->protomatter, 0, sizeof(self->protomatter));
170170

171171
// If it was supervisor-allocated, it is supervisor-freed and the pointer
172172
// is zeroed, otherwise the pointer is just zeroed
173-
_PM_FREE(self->bufinfo.buf);
173+
_PM_free(self->bufinfo.buf);
174174
self->base.type = NULL;
175175

176176
// If a framebuffer was passed in to the constructor, NULL the reference

shared-module/rgbmatrix/RGBMatrix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#pragma once
2828

29-
#include "lib/protomatter/core.h"
29+
#include "lib/protomatter/src/core.h"
3030

3131
extern const mp_obj_type_t rgbmatrix_RGBMatrix_type;
3232
typedef struct {

shared-module/rgbmatrix/allocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "py/misc.h"
3232
#include "supervisor/memory.h"
3333

34-
#define _PM_ALLOCATOR common_hal_rgbmatrix_allocator_impl
35-
#define _PM_FREE(x) (common_hal_rgbmatrix_free_impl((x)), (x)=NULL, (void)0)
34+
#define _PM_allocate common_hal_rgbmatrix_allocator_impl
35+
#define _PM_free(x) (common_hal_rgbmatrix_free_impl((x)), (x)=NULL, (void)0)
3636
extern void *common_hal_rgbmatrix_allocator_impl(size_t sz);
3737
extern void common_hal_rgbmatrix_free_impl(void *);

0 commit comments

Comments
 (0)