Skip to content

Commit bb7c32d

Browse files
committed
Fix fillScreen() bug
1 parent 21e38c7 commit bb7c32d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

DMD_RGB.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ DMD_RGB_BASE::DMD_RGB_BASE(byte mux_cnt, uint8_t* mux_list, byte _pin_nOE, byte
7070
// x3 = 3 bytes holds 4 planes "packed"
7171
if (nPlanes == 4) mem_Buffer_Size = panelsWide * panelsHigh * DMD_PIXELS_ACROSS * DMD_PIXELS_DOWN * 3 / 2;
7272
else if (nPlanes == 1) mem_Buffer_Size = panelsWide * panelsHigh * DMD_PIXELS_ACROSS * DMD_PIXELS_DOWN / 2;
73-
uint16_t allocsize = (dbuf == true) ? (mem_Buffer_Size * 2) : mem_Buffer_Size;
73+
uint32_t allocsize = (dbuf == true) ? (mem_Buffer_Size * 2ul) : mem_Buffer_Size;
7474

7575
//mux_mask = (uint16_t*)malloc(nRows * 2);
7676

@@ -340,7 +340,8 @@ void DMD_RGB_BASE::fillScreen(uint16_t c) {
340340
// For black or white, all bits in frame buffer will be identically
341341
// set or unset (regardless of weird bit packing), so it's OK to just
342342
// quickly memset the whole thing:
343-
memset(matrixbuff[backindex], c, WIDTH * nRows * 3);
343+
//memset(matrixbuff[backindex], c, WIDTH * nRows * 3);
344+
memset(matrixbuff[backindex], c, this->mem_Buffer_Size);
344345
}
345346
else {
346347
// Otherwise, need to handle it the long way:

DMD_RGB.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ class DMD_RGB<RGB32x16plainS8, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
684684
};
685685

686686
template<int COL_DEPTH>
687-
class DMD_RGB<RGB32x16plainS4, COL_DEPTH> : DMD_RGB_BASE2<COL_DEPTH>
687+
class DMD_RGB<RGB32x16plainS4, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
688688
{
689689
public:
690690
DMD_RGB(uint8_t* mux_list, byte _pin_nOE, byte _pin_SCLK, uint8_t* pinlist,
@@ -696,7 +696,7 @@ class DMD_RGB<RGB32x16plainS4, COL_DEPTH> : DMD_RGB_BASE2<COL_DEPTH>
696696
};
697697

698698
template<int COL_DEPTH>
699-
class DMD_RGB<RGB32x16plainS2, COL_DEPTH> : DMD_RGB_BASE2<COL_DEPTH>
699+
class DMD_RGB<RGB32x16plainS2, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
700700
{
701701
public:
702702
DMD_RGB(uint8_t* mux_list, byte _pin_nOE, byte _pin_SCLK, uint8_t* pinlist,

0 commit comments

Comments
 (0)