From 087e96d0d771a3a1f2019dfcd2f6e48c5140e3bd Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Thu, 24 Jun 2021 16:37:46 +0100 Subject: Inital commit --- ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index fd31f73..6e30888 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -637,6 +637,7 @@ void MatrixPanel_I2S_DMA::clearFrameBuffer(bool _buff_id){ // drive latch while shifting out last bit of RGB data row[dma_buff.rowBits[row_idx]->width - 2] |= BIT_LAT; // -1 pixel to compensate array index starting at 0 + row[dma_buff.rowBits[row_idx]->width - 1] |= BIT_LAT; // -1 pixel to compensate array index starting at 0 // need to disable OE before/after latch to hide row transition // Should be one clock or more before latch, otherwise can get ghosting @@ -661,8 +662,8 @@ void MatrixPanel_I2S_DMA::brtCtrlOE(int brt, const bool _buff_id){ if (!initialized) return; - if (brt > PIXELS_PER_ROW - m_cfg.latch_blanking) // can't control values larger than (row_width - latch_blanking) to avoid ongoing issues being raised about brightness and ghosting. - brt = PIXELS_PER_ROW - m_cfg.latch_blanking; + if (brt > PIXELS_PER_ROW - (MAX_LAT_BLANKING + 2)) // can't control values larger than (row_width - latch_blanking) to avoid ongoing issues being raised about brightness and ghosting. + brt = PIXELS_PER_ROW - (MAX_LAT_BLANKING + 2); // +2 for a bit of buffer... if (brt < 0) brt = 0; -- cgit v1.3.1 From c77c4d68ecca72b3461b633c89898d6e38183769 Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Thu, 24 Jun 2021 17:14:06 +0100 Subject: Update ESP32-HUB75-MatrixPanel-I2S-DMA.cpp --- ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index 6e30888..c21d2a1 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -687,16 +687,16 @@ void MatrixPanel_I2S_DMA::brtCtrlOE(int brt, const bool _buff_id){ // Brightness control via OE toggle - disable matrix output at specified x_coord if((coloridx > lsbMsbTransitionBit || !coloridx) && ((x_coord) >= brt)){ - row[x_coord] |= BIT_OE; continue; // For Brightness control + row[x_coord] |= BIT_OE; // Disable output after this point. + continue; } // special case for the bits *after* LSB through (lsbMsbTransitionBit) - OE is output after data is shifted, so need to set OE to fractional brightness if(coloridx && coloridx <= lsbMsbTransitionBit) { // divide brightness in half for each bit below lsbMsbTransitionBit int lsbBrightness = brt >> (lsbMsbTransitionBit - coloridx + 1); if((x_coord) >= lsbBrightness) - row[x_coord] |= BIT_OE; // For Brightness - - continue; + row[x_coord] |= BIT_OE; // Disable output after this point. + continue; } // clear OE bit for all other pixels -- cgit v1.3.1 From d339efac3ca4026880dad3b0d49f9efc36074219 Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Thu, 24 Jun 2021 17:14:54 +0100 Subject: Update ESP32-HUB75-MatrixPanel-I2S-DMA.cpp --- ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index c21d2a1..05ca84f 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -636,8 +636,8 @@ void MatrixPanel_I2S_DMA::clearFrameBuffer(bool _buff_id){ row = dma_buff.rowBits[row_idx]->getDataPtr(coloridx, _buff_id); // drive latch while shifting out last bit of RGB data - row[dma_buff.rowBits[row_idx]->width - 2] |= BIT_LAT; // -1 pixel to compensate array index starting at 0 - row[dma_buff.rowBits[row_idx]->width - 1] |= BIT_LAT; // -1 pixel to compensate array index starting at 0 + row[dma_buff.rowBits[row_idx]->width - 1] |= BIT_LAT; // -1 pixel to compensate array index starting at 0 + row[dma_buff.rowBits[row_idx]->width - 2] |= BIT_LAT; // hack / test - increase latch to two cycles. // need to disable OE before/after latch to hide row transition // Should be one clock or more before latch, otherwise can get ghosting -- cgit v1.3.1 From 547d9a7650da7c929bdab53f73cb3597bbafa4a9 Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Thu, 24 Jun 2021 17:46:45 +0100 Subject: SO MUCH FLICKER IT WILL HURT YOUR EYES --- esp32_i2s_parallel_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32_i2s_parallel_v2.c b/esp32_i2s_parallel_v2.c index 46a0ce0..79c4622 100644 --- a/esp32_i2s_parallel_v2.c +++ b/esp32_i2s_parallel_v2.c @@ -225,7 +225,7 @@ esp_err_t i2s_parallel_driver_install(i2s_port_t port, i2s_parallel_config_t* co // Output = 80000000L / tx_bck_div_num / (clkm_div_num + (clkm_div_b/clkm_div_a) ) // Note: clkm_div_num must only be set here AFTER clkm_div_b, clkm_div_a, etc. Or weird things happen! - dev->clkm_conf.clkm_div_num = clk_div_main; + dev->clkm_conf.clkm_div_num = clk_div_main*16; //printf("esp32_i2s_parallel_2.c > I2S clock divider is %d \n", clk_div_main*2); -- cgit v1.3.1 From 14ddd3a0bc922bb0d31b0f3d753b071e1d444fbc Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Thu, 24 Jun 2021 19:35:37 +0100 Subject: Revert "SO MUCH FLICKER" This reverts commit 547d9a7650da7c929bdab53f73cb3597bbafa4a9. --- esp32_i2s_parallel_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32_i2s_parallel_v2.c b/esp32_i2s_parallel_v2.c index 79c4622..46a0ce0 100644 --- a/esp32_i2s_parallel_v2.c +++ b/esp32_i2s_parallel_v2.c @@ -225,7 +225,7 @@ esp_err_t i2s_parallel_driver_install(i2s_port_t port, i2s_parallel_config_t* co // Output = 80000000L / tx_bck_div_num / (clkm_div_num + (clkm_div_b/clkm_div_a) ) // Note: clkm_div_num must only be set here AFTER clkm_div_b, clkm_div_a, etc. Or weird things happen! - dev->clkm_conf.clkm_div_num = clk_div_main*16; + dev->clkm_conf.clkm_div_num = clk_div_main; //printf("esp32_i2s_parallel_2.c > I2S clock divider is %d \n", clk_div_main*2); -- cgit v1.3.1 From 2c3919ffcf103758ce4a52e892c7960a43944e75 Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Thu, 24 Jun 2021 19:36:32 +0100 Subject: Revert "Update ESP32-HUB75-MatrixPanel-I2S-DMA.cpp" This reverts commit d339efac3ca4026880dad3b0d49f9efc36074219. --- ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index 05ca84f..c21d2a1 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -636,8 +636,8 @@ void MatrixPanel_I2S_DMA::clearFrameBuffer(bool _buff_id){ row = dma_buff.rowBits[row_idx]->getDataPtr(coloridx, _buff_id); // drive latch while shifting out last bit of RGB data - row[dma_buff.rowBits[row_idx]->width - 1] |= BIT_LAT; // -1 pixel to compensate array index starting at 0 - row[dma_buff.rowBits[row_idx]->width - 2] |= BIT_LAT; // hack / test - increase latch to two cycles. + row[dma_buff.rowBits[row_idx]->width - 2] |= BIT_LAT; // -1 pixel to compensate array index starting at 0 + row[dma_buff.rowBits[row_idx]->width - 1] |= BIT_LAT; // -1 pixel to compensate array index starting at 0 // need to disable OE before/after latch to hide row transition // Should be one clock or more before latch, otherwise can get ghosting -- cgit v1.3.1