From 8b759bc5d9e06960405088ec3391a76ab4fba5d3 Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Fri, 23 Apr 2021 21:45:50 -0700 Subject: [PATCH] TM1814 requires refreshes to remain powered off and a slightly faster refresh speed. --- wled00/FX.cpp | 2 +- wled00/FX.h | 1 + wled00/bus_manager.h | 5 +++++ wled00/cfg.cpp | 2 ++ wled00/wled.cpp | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 21d156b1b..53f5eb8e6 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -34,7 +34,7 @@ */ uint16_t WS2812FX::mode_static(void) { fill(SEGCOLOR(0)); - return (SEGMENT.getOption(SEG_OPTION_TRANSITIONAL)) ? FRAMETIME : 380; //update faster if in transition + return (SEGMENT.getOption(SEG_OPTION_TRANSITIONAL)) ? FRAMETIME : 350; //update faster if in transition } diff --git a/wled00/FX.h b/wled00/FX.h index 44eea038a..348a495e5 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -606,6 +606,7 @@ class WS2812FX { bool isRgbw = false, + isOffRefreshRequred = false, //periodic refresh is required for the strip to remain off. gammaCorrectBri = false, gammaCorrectCol = true, applyToAllSelected = true, diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index 89f3e9079..8dfd4fb39 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -399,6 +399,11 @@ class BusManager { return false; } + //Return true if the strip requires a refresh to stay off. + static bool isOffRefreshRequred(uint8_t type) { + return type == TYPE_TM1814; + } + private: uint8_t numBusses = 0; Bus* busses[WLED_MAX_BUSSES]; diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index fcfecaae2..55d9862ad 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -128,6 +128,8 @@ void deserializeConfig() { bool reversed = elm["rev"]; //RGBW mode is enabled if at least one of the strips is RGBW strip.isRgbw = (strip.isRgbw || BusManager::isRgbw(ledType)); + //refresh is required to remain off if at least one of the strips requires the refresh. + strip.isOffRefreshRequred |= BusManager::isOffRefreshRequred(ledType); s++; BusConfig bc = BusConfig(ledType, pins, start, length, colorOrder, reversed); mem += busses.memUsage(bc); diff --git a/wled00/wled.cpp b/wled00/wled.cpp index adb33ff79..3cad7652a 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -221,7 +221,7 @@ void WLED::loop() yield(); - if (!offMode) + if (!offMode || strip.isOffRefreshRequred) strip.service(); #ifdef ESP8266 else if (!noWifiSleep)