Skip to content

Commit

Permalink
Fix fillScreen() bug
Browse files Browse the repository at this point in the history
  • Loading branch information
board707 committed Feb 5, 2022
1 parent 21e38c7 commit bb7c32d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions DMD_RGB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ DMD_RGB_BASE::DMD_RGB_BASE(byte mux_cnt, uint8_t* mux_list, byte _pin_nOE, byte
// x3 = 3 bytes holds 4 planes "packed"
if (nPlanes == 4) mem_Buffer_Size = panelsWide * panelsHigh * DMD_PIXELS_ACROSS * DMD_PIXELS_DOWN * 3 / 2;
else if (nPlanes == 1) mem_Buffer_Size = panelsWide * panelsHigh * DMD_PIXELS_ACROSS * DMD_PIXELS_DOWN / 2;
uint16_t allocsize = (dbuf == true) ? (mem_Buffer_Size * 2) : mem_Buffer_Size;
uint32_t allocsize = (dbuf == true) ? (mem_Buffer_Size * 2ul) : mem_Buffer_Size;

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

Expand Down Expand Up @@ -340,7 +340,8 @@ void DMD_RGB_BASE::fillScreen(uint16_t c) {
// For black or white, all bits in frame buffer will be identically
// set or unset (regardless of weird bit packing), so it's OK to just
// quickly memset the whole thing:
memset(matrixbuff[backindex], c, WIDTH * nRows * 3);
//memset(matrixbuff[backindex], c, WIDTH * nRows * 3);
memset(matrixbuff[backindex], c, this->mem_Buffer_Size);
}
else {
// Otherwise, need to handle it the long way:
Expand Down
4 changes: 2 additions & 2 deletions DMD_RGB.h
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ class DMD_RGB<RGB32x16plainS8, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
};

template<int COL_DEPTH>
class DMD_RGB<RGB32x16plainS4, COL_DEPTH> : DMD_RGB_BASE2<COL_DEPTH>
class DMD_RGB<RGB32x16plainS4, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
{
public:
DMD_RGB(uint8_t* mux_list, byte _pin_nOE, byte _pin_SCLK, uint8_t* pinlist,
Expand All @@ -696,7 +696,7 @@ class DMD_RGB<RGB32x16plainS4, COL_DEPTH> : DMD_RGB_BASE2<COL_DEPTH>
};

template<int COL_DEPTH>
class DMD_RGB<RGB32x16plainS2, COL_DEPTH> : DMD_RGB_BASE2<COL_DEPTH>
class DMD_RGB<RGB32x16plainS2, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
{
public:
DMD_RGB(uint8_t* mux_list, byte _pin_nOE, byte _pin_SCLK, uint8_t* pinlist,
Expand Down

0 comments on commit bb7c32d

Please sign in to comment.