From 260159a6ca4a084e1fbfb810f3d30e8fe3d51707 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 13 Jan 2024 20:57:45 +0000 Subject: [PATCH] Cleanup and rename to generic Hub75 rather than SmartMatrix --- platformio.ini | 5 +- wled00/bus_manager.cpp | 16 +- wled00/bus_manager.h | 17 +- wled00/const.h | 2 +- wled00/data/settings_leds.htm | 6 +- wled00/html_settings.h | 992 +++++++++++++++++----------------- 6 files changed, 516 insertions(+), 522 deletions(-) diff --git a/platformio.ini b/platformio.ini index a6555e3b..4f84c96c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -963,7 +963,6 @@ lib_deps_V4_M = paulstoffregen/OneWire@ ^2.3.7 ; used for USERMOD_DALLASTEMPERATURE -> need newer release with bugfixes for -S3; still requires TEMPERATURE_PIN < 46 olikraus/U8g2@ ^2.34.5 ; used for USERMOD_FOUR_LINE_DISPLAY -> need newer version with bugfixes for arduino-esp32 v2.0.4 (Wire inititialization) ${common_mm.animartrix_lib_deps} - https://github.com/netmindz/SmartMatrix.git#platform-2-support build_flags_XL = -D USERMOD_WEATHER ; WLEDMM usermod @@ -1463,7 +1462,7 @@ build_flags = ${esp32_4MB_V4_S_base.build_flags} ; -D WLED_DEBUG ; -D SR_DEBUG ; -D MIC_LOGGER - -D WLED_ENABLE_SMARTMATRIX -D NO_GFX + -D WLED_ENABLE_HUB75MATRIX -D NO_GFX lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation ; RAM: [=== ] 25.1% (used 82176 bytes from 327680 bytes) @@ -2187,5 +2186,5 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-inden ; -D SR_DEBUG ; -D MIC_LOGGER -D WLED_USE_PSRAM -DBOARD_HAS_PSRAM ; tells WLED that PSRAM shall be used - -D WLED_ENABLE_SMARTMATRIX -D NO_GFX ;-D SPIRAM_FRAMEBUFFER + -D WLED_ENABLE_HUB75MATRIX -D NO_GFX ;-D SPIRAM_FRAMEBUFFER -D DEFAULT_LED_TYPE=60 \ No newline at end of file diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index 82e19644..c6f0b2ab 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -460,9 +460,9 @@ void BusNetwork::cleanup() { // *************************************************************************** -#ifdef WLED_ENABLE_SMARTMATRIX +#ifdef WLED_ENABLE_HUB75MATRIX -BusSmartMatrix::BusSmartMatrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) { +BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) { mxconfig.double_buff = false; // <------------- Turn on double buffer mxconfig.mx_width = 64; @@ -562,7 +562,7 @@ uint8_t oePin = 14; USER_PRINTLN("MatrixPanel_I2S_DMA started"); } -void BusSmartMatrix::setPixelColor(uint16_t pix, uint32_t c) { +void BusHub75Matrix::setPixelColor(uint16_t pix, uint32_t c) { r = R(c); g = G(c); b = B(c); @@ -571,7 +571,7 @@ void BusSmartMatrix::setPixelColor(uint16_t pix, uint32_t c) { display->drawPixelRGB888(x, y, r, g, b); } -void BusSmartMatrix::setBrightness(uint8_t b, bool immediate) { +void BusHub75Matrix::setBrightness(uint8_t b, bool immediate) { this->display->setBrightness(b); } #endif @@ -604,10 +604,10 @@ int BusManager::add(BusConfig &bc) { USER_PRINTF("BusManager::add(bc.type=%u)\n", bc.type); if (bc.type >= TYPE_NET_DDP_RGB && bc.type < 96) { busses[numBusses] = new BusNetwork(bc); -#ifdef WLED_ENABLE_SMARTMATRIX - } else if (bc.type == TYPE_SMARTMATRIX) { - USER_PRINTLN("BusManager::add - Adding BusSmartMatrix"); - busses[numBusses] = new BusSmartMatrix(bc); +#ifdef WLED_ENABLE_HUB75MATRIX + } else if (bc.type >= TYPE_HUB75MATRIX && bc.type <= (TYPE_HUB75MATRIX + 10)) { + USER_PRINTLN("BusManager::add - Adding BusHub75Matrix"); + busses[numBusses] = new BusHub75Matrix(bc); #endif } else if (IS_DIGITAL(bc.type)) { busses[numBusses] = new BusDigital(bc, numBusses, colorOrderMap); diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index bd7cd4b9..30211624 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -1,7 +1,7 @@ #ifndef BusManager_h #define BusManager_h -#ifdef WLED_ENABLE_SMARTMATRIX +#ifdef WLED_ENABLE_HUB75MATRIX #include #endif /* @@ -41,7 +41,7 @@ struct BusConfig { if (type >= TYPE_NET_DDP_RGB && type < 96) nPins = 4; //virtual network bus. 4 "pins" store IP address else if (type > 47) nPins = 2; else if (type > 40 && type < 46) nPins = NUM_PWM_PINS(type); - else if (type == TYPE_SMARTMATRIX) nPins = 0; + else if (type == TYPE_HUB75MATRIX) nPins = 0; for (uint8_t i = 0; i < nPins; i++) pins[i] = ppins[i]; } @@ -330,10 +330,10 @@ class BusNetwork : public Bus { byte *_data; }; -#ifdef WLED_ENABLE_SMARTMATRIX -class BusSmartMatrix : public Bus { +#ifdef WLED_ENABLE_HUB75MATRIX +class BusHub75Matrix : public Bus { public: - BusSmartMatrix(BusConfig &bc); + BusHub75Matrix(BusConfig &bc); bool hasRGB() { return true; } bool hasWhite() { return false; } @@ -347,18 +347,13 @@ class BusSmartMatrix : public Bus { } } - bool canShow() { - // busy swapping still - return true; // return !backgroundLayer->isSwapPending(); - } - void setBrightness(uint8_t b, bool immediate); // uint8_t getPins(uint8_t* pinArray) {} // todo void cleanup() {} - ~BusSmartMatrix() { + ~BusHub75Matrix() { cleanup(); } diff --git a/wled00/const.h b/wled00/const.h index a7b3d416..49467dcb 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -241,7 +241,7 @@ #define TYPE_P9813 53 #define TYPE_LPD6803 54 -#define TYPE_SMARTMATRIX 100 +#define TYPE_HUB75MATRIX 100 // 100 - 110 //Network types (master broadcast) (80-95) #define TYPE_NET_DDP_RGB 80 //network DDP RGB bus (master broadcast bus) diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 302f9b91..ce9e710a 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -368,9 +368,9 @@ ${i+1}: - - - + + +
Color Order: