From 7f0191bd118b7a1fae6b130e87475095f4cd7e30 Mon Sep 17 00:00:00 2001 From: tonyxforce Date: Thu, 24 Aug 2023 23:47:57 +0200 Subject: [PATCH] Minor code modifications/clean up --- wled00/FX.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 5811e687..1e74b4c7 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -1923,12 +1923,18 @@ static const char _data_FX_MODE_PRIDE_2015[] PROGMEM = "Pride 2015@!;;"; uint16_t mode_jbl() { - static uint16_t mode_jbl_pos = 0; - + if (SEGENV.call == 0) { + SEGMENT.fill(BLACK); // clear LEDs + SEGENV.aux0 = 0; + SEGENV.aux1 = 0; + SEGENV.step = 0; + } + /* * use of persistent variables: * aux0: hueDelay * aux1: hue + * step: pos */ um_data_t *um_data; @@ -1962,9 +1968,9 @@ uint16_t mode_jbl() { speed = 20; }; - mode_jbl_pos += speed; + SEGENV.step += speed; - counter = mode_jbl_pos >> 8; + counter = SEGENV.step >> 8; for (uint16_t i = 0; i < SEGLEN; i++) {