Skip to content

Commit e8018dd

Browse files
Merge pull request #32 from jepler/circuitpython-build-fixes
Circuitpython build fixes
2 parents 75965eb + 5e925ce commit e8018dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "core.h" // enums and structs
3333
#include "arch/arch.h" // Do NOT include this in any other source files
3434
#include <stddef.h>
35+
#include <stdlib.h>
3536
#include <string.h>
3637

3738
// Overall matrix refresh rate (frames/second) is a function of matrix width
@@ -935,12 +936,13 @@ __attribute__((noinline)) void _PM_convert_565_byte(Protomatter_core *core,
935936

936937
// Work from bottom tile to top, because data is issued in that order
937938
for (int8_t tile = abs(core->tile) - 1; tile >= 0; tile--) {
938-
uint16_t *upperSrc, *lowerSrc; // Canvas scanline pointers
939+
const uint16_t *upperSrc, *lowerSrc; // Canvas scanline pointers
939940
int16_t srcIdx;
940941
int8_t srcInc;
941942

942943
// Source pointer to tile's upper-left pixel
943-
uint16_t *srcTileUL = source + tile * width * core->numRowPairs * 2;
944+
const uint16_t *srcTileUL =
945+
source + tile * width * core->numRowPairs * 2;
944946
if ((tile & 1) && (core->tile < 0)) {
945947
// Special handling for serpentine tiles
946948
lowerSrc = srcTileUL + width * (core->numRowPairs - 1 - row);

0 commit comments

Comments
 (0)