aboutsummaryrefslogtreecommitdiff
path: root/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp
diff options
context:
space:
mode:
authormrfaptastic <12006953+mrfaptastic@users.noreply.github.com>2023-01-20 07:24:59 +0000
committerGitHub <noreply@github.com>2023-01-20 07:24:59 +0000
commit6687ee7d8255d9762df0747b568951b53a06e6dd (patch)
treea8d38f13671ad6479ac245a0188b40dfd195b545 /src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp
parentc1d85fad42386ce01cd881d82059ff570f3b2093 (diff)
parentffd196d9e5b7f1a9bdd96bfbb33f60ace10e207f (diff)
Merge pull request #374 from Kouzeru/master
BCM accumulation correction
Diffstat (limited to 'src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp')
-rw-r--r--src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp
index 107e24d..383643e 100644
--- a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp
+++ b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp
@@ -692,7 +692,6 @@ void MatrixPanel_I2S_DMA::brtCtrlOEv2(uint8_t brt, const int _buff_id) {
brt = 0;
*/
- int brightness_in_x_pixels = PIXELS_PER_ROW * ((float)brt/256);
//Serial.println(brightness_in_x_pixels, DEC);
uint8_t _blank = m_cfg.latch_blanking; // don't want to inadvertantly blast over this
@@ -706,6 +705,7 @@ void MatrixPanel_I2S_DMA::brtCtrlOEv2(uint8_t brt, const int _buff_id) {
// let's set OE control bits for specific pixels in each color_index subrows
uint8_t colouridx = dma_buff.rowBits[row_idx]->colour_depth;
do {
+ int brightness_in_x_pixels = PIXELS_PER_ROW * brt >> 8 + max( ( dma_buff.rowBits[row_idx]->colour_depth - colouridx - 2 ), 0);
--colouridx;
// switch pointer to a row for a specific color index