From 75481d325151718b802411c9f4974cd5454748b6 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 20 Sep 2025 15:20:38 +0100 Subject: [PATCH 1/6] Disable VirtualMatrixPanel, CHAIN_BOTTOM_LEFT_UP incomplete --- wled00/bus_manager.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index 40014e2c6..eda188dd6 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -812,14 +812,15 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc. virtualDisp = nullptr; if (bc.type == TYPE_HUB75MATRIX_HS) { - mxconfig.mx_width = min((u_int8_t) 64, bc.pins[0]); - mxconfig.mx_height = min((u_int8_t) 64, bc.pins[1]); - if(bc.pins[2] > 1 && bc.pins[3] > 0 && bc.pins[4]) { - virtualDisp = new VirtualMatrixPanel((*display), bc.pins[3], bc.pins[4], mxconfig.mx_width, mxconfig.mx_height, CHAIN_BOTTOM_LEFT_UP); - } + mxconfig.mx_width = min((uint8_t) 64, bc.pins[0]); + mxconfig.mx_height = min((uint8_t) 64, bc.pins[1]); + // Disable chains of panels for now, incomplete UI changes + // if(bc.pins[2] > 1 && bc.pins[3] != 0 && bc.pins[4] != 0 && bc.pins[3] != 255 && bc.pins[4] != 255) { + // virtualDisp = new VirtualMatrixPanel((*display), bc.pins[3], bc.pins[4], mxconfig.mx_width, mxconfig.mx_height, CHAIN_BOTTOM_LEFT_UP); + // } } else if (bc.type == TYPE_HUB75MATRIX_QS) { - mxconfig.mx_width = min((u_int8_t) 64, bc.pins[0]) * 2; - mxconfig.mx_height = min((u_int8_t) 64, bc.pins[1]) / 2; + mxconfig.mx_width = min((uint8_t) 64, bc.pins[0]) * 2; + mxconfig.mx_height = min((uint8_t) 64, bc.pins[1]) / 2; virtualDisp = new VirtualMatrixPanel((*display), 1, 1, bc.pins[0], bc.pins[1]); virtualDisp->setRotation(0); switch(bc.pins[1]) { @@ -849,7 +850,7 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc. } else mxconfig.setPixelColorDepthBits(8); #endif - mxconfig.chain_length = max((u_int8_t) 1, min(bc.pins[2], (u_int8_t) 4)); // prevent bad data preventing boot due to low memory + mxconfig.chain_length = max((uint8_t) 1, min(bc.pins[2], (uint8_t) 4)); // prevent bad data preventing boot due to low memory if(mxconfig.mx_height >= 64 && (mxconfig.chain_length > 1)) { DEBUGBUS_PRINTLN("WARNING, only single panel can be used of 64 pixel boards due to memory"); From 6c718c3558d9b36d9f72ca2bf75a9c2697911741 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 20 Sep 2025 15:30:36 +0100 Subject: [PATCH 2/6] Remove legacy code for double buffer --- wled00/bus_manager.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index eda188dd6..b647d94fc 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -997,7 +997,6 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc. DEBUGBUS_PRINT(F("MatrixPanel_I2S_DMA ")); DEBUGBUS_PRINTF("%sstarted, width=%u, %u pixels.\n", _valid? "":"not ", _panelWidth, _len); - if (mxconfig.double_buff == true) DEBUGBUS_PRINTLN(F("MatrixPanel_I2S_DMA driver native double-buffering enabled.")); if (_ledBuffer != nullptr) DEBUGBUS_PRINTLN(F("MatrixPanel_I2S_DMA LEDS buffer enabled.")); if (_ledsDirty != nullptr) DEBUGBUS_PRINTLN(F("MatrixPanel_I2S_DMA LEDS dirty bit optimization enabled.")); if ((_ledBuffer != nullptr) || (_ledsDirty != nullptr)) { @@ -1083,13 +1082,6 @@ void BusHub75Matrix::show(void) { } setBitArray(_ledsDirty, _len, false); // buffer shown - reset all dirty bits } - - if(mxconfig.double_buff) { - display->flipDMABuffer(); // Show the back buffer, set current output buffer to the back (i.e. no longer being sent to LED panels) - // while(!previousBufferFree) delay(1); // experimental - Wait before we allow any writing to the buffer. Stop flicker. - display->clearScreen(); // Now clear the back-buffer - setBitArray(_ledsDirty, _len, false); // dislay buffer is blank - reset all dirty bits - } } void BusHub75Matrix::cleanup() { From c5119c8aa6d3c1d7b0a00fbdec0fee47d755c8e3 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 20 Sep 2025 16:41:36 +0100 Subject: [PATCH 3/6] Remove NO_CIE1931 to better sit with other Gamma correction changes in WLED --- platformio_override.sample.ini | 21 +++++++++++++++------ wled00/bus_manager.cpp | 6 ------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/platformio_override.sample.ini b/platformio_override.sample.ini index 597f48738..cd22d5854 100644 --- a/platformio_override.sample.ini +++ b/platformio_override.sample.ini @@ -549,11 +549,12 @@ platform_packages = build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} -D WLED_RELEASE_NAME=\"ESP32_hub75\" - -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931 - ; -D ESP32_FORUM_PINOUT ;; enable for SmartMatrix default pins + -D WLED_ENABLE_HUB75MATRIX -D NO_GFX + -D LED_TYPES=65 + -D WLED_DEBUG_BUS ; -D WLED_DEBUG lib_deps = ${esp32_idf_V4.lib_deps} - https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#3.0.11 + https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#3.0.12 monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.default_partitions} @@ -563,11 +564,14 @@ board_build.flash_mode = dio extends = env:esp32dev_hub75 build_flags = ${common.build_flags} -D WLED_RELEASE_NAME=\"ESP32_hub75_forum_pinout\" - -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931 + -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D ESP32_FORUM_PINOUT ;; enable for SmartMatrix default pins + -D LED_TYPES=65 + -D WLED_DEBUG_BUS ; -D WLED_DEBUG + [env:adafruit_matrixportal_esp32s3] ; ESP32-S3 processor, 8 MB flash, 2 MB of PSRAM, dedicated driver pins for HUB75 board = adafruit_matrixportal_esp32s3 @@ -581,9 +585,12 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= -DLOLIN_WIFI_FIX ; seems to work much better with this -D WLED_WATCHDOG_TIMEOUT=0 ${esp32.AR_build_flags} - -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931 + -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips -D ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3 + -D LED_TYPES=65 + -D WLED_DEBUG_BUS + lib_deps = ${esp32s3.lib_deps} ${esp32.AR_lib_deps} @@ -607,9 +614,11 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= -DLOLIN_WIFI_FIX ; seems to work much better with this -D WLED_WATCHDOG_TIMEOUT=0 ${esp32.AR_build_flags} - -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931 + -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips -D MOONHUB_S3_PINOUT ;; HUB75 pinout + -D LED_TYPES=65 + -D WLED_DEBUG_BUS lib_deps = ${esp32s3.lib_deps} ${esp32.AR_lib_deps} diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index b647d94fc..c2838425e 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -1021,9 +1021,6 @@ void __attribute__((hot)) BusHub75Matrix::setPixelColor(unsigned pix, uint32_t c if ((c == IS_BLACK) && (getBitFromArray(_ledsDirty, pix) == false)) return; // ignore black if pixel is already black setBitInArray(_ledsDirty, pix, c != IS_BLACK); // dirty = true means "color is not BLACK" - #ifndef NO_CIE1931 - c = unGamma24(c); // to use the driver linear brightness feature, we first need to undo WLED gamma correction - #endif uint8_t r = R(c); uint8_t g = G(c); uint8_t b = B(c); @@ -1069,9 +1066,6 @@ void BusHub75Matrix::show(void) { for (int y=0; y Date: Sat, 20 Sep 2025 16:49:15 +0100 Subject: [PATCH 4/6] Rollback to ESP32-HUB75-MatrixPanel-DMA.git#3.0.11 --- platformio_override.sample.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio_override.sample.ini b/platformio_override.sample.ini index cd22d5854..fdc45e0b3 100644 --- a/platformio_override.sample.ini +++ b/platformio_override.sample.ini @@ -554,7 +554,7 @@ build_flags = ${common.build_flags} -D WLED_DEBUG_BUS ; -D WLED_DEBUG lib_deps = ${esp32_idf_V4.lib_deps} - https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#3.0.12 + https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#3.0.11 monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.default_partitions} From ee5a70a63ea67fb7a1bde03dac2e7b1dcbd06a40 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 20 Sep 2025 18:03:08 +0100 Subject: [PATCH 5/6] Update: getNumberOfPins to load all pins from config for hub75 --- wled00/bus_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index 31df680ae..f9b94e734 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -165,7 +165,7 @@ class Bus { inline bool containsPixel(uint16_t pix) const { return pix >= _start && pix < _start + _len; } static inline std::vector getLEDTypes() { return {{TYPE_NONE, "", PSTR("None")}}; } // not used. just for reference for derived classes - static constexpr size_t getNumberOfPins(uint8_t type) { return isVirtual(type) ? 4 : isPWM(type) ? numPWMPins(type) : is2Pin(type) + 1; } // credit @PaoloTK + static constexpr size_t getNumberOfPins(uint8_t type) { return isVirtual(type) ? 4 : isPWM(type) ? numPWMPins(type) : isHub75(type) ? 3 : is2Pin(type) + 1; } // credit @PaoloTK static constexpr size_t getNumberOfChannels(uint8_t type) { return hasWhite(type) + 3*hasRGB(type) + hasCCT(type); } static constexpr bool hasRGB(uint8_t type) { return !((type >= TYPE_WS2812_1CH && type <= TYPE_WS2812_WWA) || type == TYPE_ANALOG_1CH || type == TYPE_ANALOG_2CH || type == TYPE_ONOFF); From 77f342686720d78554861be05149dedb986109d5 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 20 Sep 2025 18:39:02 +0100 Subject: [PATCH 6/6] Default to 64x64 single panel, hacky it is done by pins but until we refactor bus config to be more flexible, this is what we have to work around --- platformio_override.sample.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platformio_override.sample.ini b/platformio_override.sample.ini index fdc45e0b3..8a241f3f7 100644 --- a/platformio_override.sample.ini +++ b/platformio_override.sample.ini @@ -550,7 +550,7 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} -D WLED_RELEASE_NAME=\"ESP32_hub75\" -D WLED_ENABLE_HUB75MATRIX -D NO_GFX - -D LED_TYPES=65 + -D LED_TYPES=65 -D DATA_PINS=64,64,1 -D WLED_DEBUG_BUS ; -D WLED_DEBUG lib_deps = ${esp32_idf_V4.lib_deps} @@ -566,7 +566,7 @@ build_flags = ${common.build_flags} -D WLED_RELEASE_NAME=\"ESP32_hub75_forum_pinout\" -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D ESP32_FORUM_PINOUT ;; enable for SmartMatrix default pins - -D LED_TYPES=65 + -D LED_TYPES=65 -D DATA_PINS=64,64,1 -D WLED_DEBUG_BUS ; -D WLED_DEBUG @@ -588,7 +588,7 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips -D ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3 - -D LED_TYPES=65 + -D LED_TYPES=65 -D DATA_PINS=64,64,1 -D WLED_DEBUG_BUS @@ -617,7 +617,7 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips -D MOONHUB_S3_PINOUT ;; HUB75 pinout - -D LED_TYPES=65 + -D LED_TYPES=65 -D DATA_PINS=64,64,1 -D WLED_DEBUG_BUS lib_deps = ${esp32s3.lib_deps}