diff --git a/platformio.ini b/platformio.ini index 0c1e4983..cada2748 100644 --- a/platformio.ini +++ b/platformio.ini @@ -2306,3 +2306,4 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-inden lib_deps = ${esp32_4MB_V4_S_base.esp32_lib_deps} ${common_mm.animartrix_lib_deps} lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation +monitor_filters = esp32_exception_decoder diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index 603fcec6..9d71bf41 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -465,6 +465,9 @@ void BusNetwork::cleanup() { BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) { mxconfig.double_buff = false; // <------------- Turn on double buffer + + fourScanPanel = nullptr; + switch(bc.type) { case 101: mxconfig.mx_width = 32; @@ -478,6 +481,14 @@ BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWh mxconfig.mx_width = 64; mxconfig.mx_height = 64; break; + case 105: + mxconfig.mx_width = 32 * 2; + mxconfig.mx_height = 32 / 2; + break; + case 106: + mxconfig.mx_width = 64 * 2; + mxconfig.mx_height = 64 / 2; + break; } // mxconfig.driver = HUB75_I2S_CFG::SHIFTREG; @@ -554,13 +565,27 @@ BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWh #endif - this->_len = (mxconfig.mx_width * mxconfig.mx_height); USER_PRINTLN("MatrixPanel_I2S_DMA config"); // OK, now we can create our matrix object display = new MatrixPanel_I2S_DMA(mxconfig); + switch(bc.type) { + case 105: + USER_PRINTLN("MatrixPanel_I2S_DMA FOUR_SCAN_16PX_HIGH"); + fourScanPanel = new VirtualMatrixPanel((*display), 1, 1, 32, 32); + fourScanPanel->setPhysicalPanelScanRate(FOUR_SCAN_16PX_HIGH); + break; + case 106: + USER_PRINTLN("MatrixPanel_I2S_DMA FOUR_SCAN_32PX_HIGH"); + fourScanPanel = new VirtualMatrixPanel((*display), 1, 1, 64, 64); + fourScanPanel->setPhysicalPanelScanRate(FOUR_SCAN_32PX_HIGH); + break; + } + + this->_len = (display->width() * display->height()); + pinManager.allocatePin(mxconfig.gpio.r1, true, PinOwner::HUB75); pinManager.allocatePin(mxconfig.gpio.g1, true, PinOwner::HUB75); pinManager.allocatePin(mxconfig.gpio.b1, true, PinOwner::HUB75); @@ -601,7 +626,12 @@ void BusHub75Matrix::setPixelColor(uint16_t pix, uint32_t c) { b = B(c); x = pix % mxconfig.mx_width; y = floor(pix / mxconfig.mx_width); - display->drawPixelRGB888(x, y, r, g, b); + if(fourScanPanel != nullptr) { + fourScanPanel->drawPixelRGB888(x, y, r, g, b); + } + else { + display->drawPixelRGB888(x, y, r, g, b); + } } void BusHub75Matrix::setBrightness(uint8_t b, bool immediate) { diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index 6f20619c..01e8a3e4 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -3,6 +3,7 @@ #ifdef WLED_ENABLE_HUB75MATRIX #include +#include #endif /* * Class for addressing various light types @@ -355,6 +356,8 @@ class BusHub75Matrix : public Bus { void cleanup() { deallocatePins(); + fourScanPanel = nullptr; + // delete fourScanPanel; delete display; _valid = false; } @@ -365,6 +368,7 @@ class BusHub75Matrix : public Bus { private: MatrixPanel_I2S_DMA *display = nullptr; + VirtualMatrixPanel *fourScanPanel = nullptr; HUB75_I2S_CFG mxconfig; uint8_t r, g, b, x, y; diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 7b70f554..d5c8ae19 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -386,6 +386,8 @@ ${i+1}: + +
Color Order: