From 7b28387bb470ddd686d17c2306252013f3bdd3c6 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Wed, 9 Aug 2023 17:23:21 +0200 Subject: [PATCH] Comments from Aircoookie addressed --- wled00/FX_fcn.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 513b5c2f..3d9b7d31 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -1170,13 +1170,13 @@ void WS2812FX::service() { _segment_index = 0; Segment::handleRandomPalette(); // move it into for loop when each segment has individual random palette for (segment &seg : _segments) { - if (!seg.isActive()) continue; - // process transition (mode changes in the middle of transition) seg.handleTransition(); // reset the segment runtime data if needed seg.resetIfRequired(); + if (!seg.isActive()) continue; + // last condition ensures all solid segments are updated at the same time if (nowUp > seg.next_time || _triggered || (doShow && seg.mode == FX_MODE_STATIC)) { @@ -1387,9 +1387,7 @@ void WS2812FX::setMode(uint8_t segid, uint8_t m) { if (m >= getModeCount()) m = getModeCount() - 1; if (_segments[segid].mode != m) { - _segments[segid].startTransition(_transitionDur); // set effect transitions - //_segments[segid].markForReset(); - _segments[segid].mode = m; + _segments[segid].setMode(m); // do not load defaults } }