From 59ca792c9d7bc6b90f04ae640c6e2827ea826f15 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Sat, 28 Sep 2024 02:45:16 +0200 Subject: [PATCH] HUB75: trade bit depth against memory needs gradually reduce bitdepts on esp32 --- wled00/bus_manager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index 66a417e89f..cb3d8fac34 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -579,6 +579,14 @@ BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWh break; } +#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2)// classic esp32, or esp32-s2: reduce bitdepth for large panels + if (mxconfig.mx_height >= 64) { + if (mxconfig.chain_length * mxconfig.mx_width > 192) mxconfig.setPixelColorDepthBits(3); + else if (mxconfig.chain_length * mxconfig.mx_width > 64) mxconfig.setPixelColorDepthBits(4); + else mxconfig.setPixelColorDepthBits(8); + } else mxconfig.setPixelColorDepthBits(8); +#endif + #if defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) // MatrixPortal ESP32-S3 // https://www.adafruit.com/product/5778