From 76aa3072b678db49d1ccea7d44fe3f85ead8fc4c Mon Sep 17 00:00:00 2001 From: Ewoud Date: Mon, 2 Oct 2023 12:45:56 +0200 Subject: [PATCH] Octopus and Crazy Bees Super Sync compatible --- wled00/FX.cpp | 9 +++++---- wled00/wled.cpp | 2 ++ wled00/wled.h | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 8cd6d92e..140cc434 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -5771,7 +5771,7 @@ uint16_t mode_2Dcrazybees(void) { uint8_t posX, posY, aimX, aimY, hue; int8_t deltaX, deltaY, signX, signY, error; void aimed(uint16_t w, uint16_t h) { - random16_set_seed(strip.now); + //WLEDMM seed NOT here for SuperSync aimX = random8(0, w); aimY = random8(0, h); hue = random8(); @@ -5787,6 +5787,7 @@ uint16_t mode_2Dcrazybees(void) { bee_t *bee = reinterpret_cast(SEGENV.data); if (SEGENV.call == 0) { + random16_set_seed(strip.now); //WLEDMM seed here for SuperSync SEGMENT.setUpLeds(); SEGMENT.fill(BLACK); for (size_t i = 0; i < n; i++) { @@ -7847,7 +7848,7 @@ uint16_t mode_2Dsoap() { const uint32_t mov = MIN(cols,rows)*(SEGMENT.speed+2)/2; const uint8_t smoothness = MIN(250,SEGMENT.intensity); // limit as >250 produces very little changes - //WLEDMM: changing noise calculation for super sync to make it deterministic using strip.now + //WLEDMM: changing noise calculation for SuperSync to make it deterministic using strip.now // init if (SEGENV.call == 0) { random16_set_seed(535); @@ -7964,7 +7965,7 @@ uint16_t mode_2Doctopus() { // re-init if SEGMENT dimensions or offset changed if (SEGENV.call == 0 || SEGENV.aux0 != cols || SEGENV.aux1 != rows || SEGMENT.custom1 != *offsX || SEGMENT.custom2 != *offsY) { - SEGENV.step = 0; // t + // SEGENV.step = 0; // t SEGENV.aux0 = cols; SEGENV.aux1 = rows; *offsX = SEGMENT.custom1; @@ -7979,7 +7980,7 @@ uint16_t mode_2Doctopus() { } } - SEGENV.step += SEGMENT.speed / 32 + 1; // 1-4 range + SEGENV.step = (strip.now / 40) * (SEGMENT.speed / 32 + 1); // 1-4 range WLEDMM no += because of SuperSync (40fps effect) for (int x = 0; x < cols; x++) { for (int y = 0; y < rows; y++) { byte angle = rMap[XY(x,y)].angle; diff --git a/wled00/wled.cpp b/wled00/wled.cpp index f8871355..dba77245 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -3,6 +3,8 @@ #include "wled_ethernet.h" #include +#warning WLED-MM GPL-v3. By installing WLED MM you implicitly accept the terms! + #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_DISABLE_BROWNOUT_DET) #include "soc/soc.h" #include "soc/rtc_cntl_reg.h" diff --git a/wled00/wled.h b/wled00/wled.h index f7ceed76..15c62b92 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2310010 +#define VERSION 2310020 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG @@ -65,7 +65,7 @@ //This is generally a terrible idea, but improves boot success on boards with a 3.3v regulator + cap setup that can't provide 400mA peaks //#define WLED_DISABLE_BROWNOUT_DET -// WLED-MM MANDATORY flags +// WLEDMM MANDATORY flags #define WLEDMM_PROTECT_SERVICE // prevents crashes when effects are drawing while asyncWebServer tries to modify segments at the same time // Library inclusions.