diff --git a/CHANGELOG.md b/CHANGELOG.md index 59a4bad14..6172e26d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ### Builds after release 0.12.0 +#### Build 2104210 + +- Added `tb` to JSON state, allowing setting the timebase (set tb=0 to start e.g. wipe effect from the beginning). Receive only. +- Slightly raised Solid mode refresh rate to work with LEDs (TM1814) that require refresh rates of at least 2fps +- Added sunrise and sunset calculation to the backup JSON time source + #### Build 2104151 - `NUM_STRIPS` no longer required with compile-time strip defaults diff --git a/wled00/FX.cpp b/wled00/FX.cpp index d64e6f80e..0e60f9e9e 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -35,7 +35,7 @@ */ uint16_t WS2812FX::mode_static(void) { fill(SEGCOLOR(0)); - return (SEGMENT.getOption(SEG_OPTION_TRANSITIONAL)) ? FRAMETIME : 500; //update faster if in transition + return (SEGMENT.getOption(SEG_OPTION_TRANSITIONAL)) ? FRAMETIME : 380; //update faster if in transition } diff --git a/wled00/json.cpp b/wled00/json.cpp index 1ff090c2d..ffb2714ca 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -182,6 +182,9 @@ bool deserializeState(JsonObject root) jsonTransitionOnce = true; } strip.setTransition(transitionDelayTemp); + + tr = root[F("tb")] | -1; + if (tr >= 0) strip.timebase = ((uint32_t)tr) - millis(); int cy = root[F("pl")] | -2; if (cy > -2) presetCyclingEnabled = (cy >= 0); @@ -203,9 +206,16 @@ bool deserializeState(JsonObject root) receiveNotifications = udpn["recv"] | receiveNotifications; bool noNotification = udpn[F("nn")]; //send no notification just for this request - unsigned long timein = root[F("time")] | UINT32_MAX; + unsigned long timein = root[F("time")] | UINT32_MAX; //backup time source if NTP not synced if (timein != UINT32_MAX) { - if (millis() - ntpLastSyncTime > 50000000L) setTime(timein); + time_t prev = now(); + if (millis() - ntpLastSyncTime > 50000000L) { + setTime(timein); + if (abs(now() - prev) > 60L) { + updateLocalTime(); + calculateSunriseAndSunset(); + } + } if (presetsModifiedTime == 0) presetsModifiedTime = timein; } diff --git a/wled00/wled.h b/wled00/wled.h index 5294f8cc1..8391e4250 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2104151 +#define VERSION 2104210 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG