Skip to content

Commit c5fd8d2

Browse files
authored
Update ESP32-HUB75-MatrixPanel-I2S-DMA.cpp
1 parent 84d4388 commit c5fd8d2

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -510,45 +510,41 @@ void MatrixPanel_I2S_DMA::clearFrameBuffer(bool _buff_id)
510510
--row_idx;
511511

512512
ESP32_I2S_DMA_STORAGE_TYPE *row = fb->rowBits[row_idx]->getDataPtr(0); // set pointer to the HEAD of a buffer holding data for the entire matrix row
513-
514513
ESP32_I2S_DMA_STORAGE_TYPE abcde = (ESP32_I2S_DMA_STORAGE_TYPE)row_idx;
515514

516515
// get last pixel index in a row of all colourdepths
517516
int x_pixel = fb->rowBits[row_idx]->width * fb->rowBits[row_idx]->colour_depth;
518-
517+
519518
abcde <<= BITS_ADDR_OFFSET; // shift row y-coord to match ABCDE bits in vector from 8 to 12
520519
do
521520
{
522521
--x_pixel;
523-
524522
if (m_cfg.driver == HUB75_I2S_CFG::SM5266P)
525523
{
526-
// modifications here for row shift register type SM5266P
527-
// https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-I2S-DMA/issues/164
528-
row[x_pixel] = abcde & (0x18 << BITS_ADDR_OFFSET); // mask out the bottom 3 bits which are the clk di bk inputs
524+
// modifications here for row shift register type SM5266P
525+
// https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-I2S-DMA/issues/164
526+
row[x_pixel] = abcde & (0x18 << BITS_ADDR_OFFSET); // mask out the bottom 3 bits which are the clk di bk inputs
529527
}
530528
else if (m_cfg.driver == HUB75_I2S_CFG::DP3246_SM5368)
531529
{
532-
row[ESP32_TX_FIFO_POSITION_ADJUST(x_pixel)] = 0x0000;
530+
row[ESP32_TX_FIFO_POSITION_ADJUST(x_pixel)] = 0x0000;
533531
}
534532
else
535533
{
536-
row[ESP32_TX_FIFO_POSITION_ADJUST(x_pixel)] = abcde;
534+
row[ESP32_TX_FIFO_POSITION_ADJUST(x_pixel)] = abcde;
537535
}
538536

539537
} while (x_pixel != fb->rowBits[row_idx]->width); // spare the first "width's" worth of pixels as they are the LSB pixels/colordepth
540538

541-
// colour_index[0] (LSB) x_pixels must be "marked" with a previous's row address, 'cause it is used to display
542-
// previous row while we pump in MSBs's for a new row
543-
539+
// The colour_index[0] (LSB) x_pixels must be "marked" with a previous's row address, because it is used to display
540+
// previous row while we pump in MSBs's for the next row.
544541
if (row_idx == 0) {
545542
abcde = ROWS_PER_FRAME-1; // wrap around
546543
} else {
547544
abcde = row_idx-1;
548545
}
549-
546+
550547
abcde <<= BITS_ADDR_OFFSET; // shift row y-coord to match ABCDE bits in vector from 8 to 12
551-
552548
do
553549
{
554550
--x_pixel;

0 commit comments

Comments
 (0)