Skip to content

Commit f21b294

Browse files
committed
fix for effect double restart problem when cross-fade is enabled
we only use palette and brightness transitions, so effect restart at the transition end is not required.
1 parent 59d5ff0 commit f21b294

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

wled00/FX_fcn.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,12 @@ void Segment::setCurrentPalette() {
494494
}
495495

496496
void Segment::handleTransition() {
497-
if (!transitional) return;
497+
if (!transitional || !_t) return; // Early exit if no transition active
498498
unsigned long maxWait = millis() + 20;
499499
if (mode == FX_MODE_STATIC && next_time > maxWait) next_time = maxWait;
500500
if (progress() == 0xFFFFU) {
501501
if (_t) {
502-
if (_t->_modeP != mode) markForReset();
502+
//if (_t->_modeP != mode) markForReset(); // WLEDMM effect transition disabled as it does not work (flashes due to double effect restart)
503503
delete _t;
504504
_t = nullptr;
505505
}
@@ -618,7 +618,7 @@ void Segment::setMode(uint8_t fx, bool loadDefaults, bool sliderDefaultsOnly) {
618618
sOpt = extractModeDefaults(fx, "pal"); if (sOpt >= 0) {if (oldPalette==-1) oldPalette = palette; setPalette(sOpt);} else {if (oldPalette!=-1) setPalette(oldPalette); oldPalette = -1;}
619619
}
620620
}
621-
if (!fadeTransition) markForReset(); // WLEDMM quickfix for effect "double startup" bug. -> only works when "Crossfade" is disabled (led settings)
621+
/*if (!fadeTransition)*/ markForReset(); // WLEDMM quickfix for effect "double startup" bug.
622622
stateChanged = true; // send UDP/WS broadcast
623623
}
624624
}

wled00/wled.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
// version code in format yymmddb (b = daily build)
11-
#define VERSION 2411270
11+
#define VERSION 2411271
1212

1313
// WLEDMM - you can check for this define in usermods, to only enabled WLEDMM specific code in the "right" fork. Its not defined in AC WLED.
1414
#define _MoonModules_WLED_
@@ -393,7 +393,7 @@ WLED_GLOBAL byte briS _INIT(128); // default brightness
393393
WLED_GLOBAL byte nightlightTargetBri _INIT(0); // brightness after nightlight is over
394394
WLED_GLOBAL byte nightlightDelayMins _INIT(60);
395395
WLED_GLOBAL byte nightlightMode _INIT(NL_MODE_FADE); // See const.h for available modes. Was nightlightFade
396-
WLED_GLOBAL bool fadeTransition _INIT(false); // enable crossfading color transition // WLEDMM disabled - has bugs that will be solved in upstream beta4
396+
WLED_GLOBAL bool fadeTransition _INIT(true); // enable crossfading color transition // WLEDMM only do color x-fade -- effect x-fade has bugs that will be solved in upstream beta4
397397
WLED_GLOBAL uint16_t transitionDelay _INIT(750); // default crossfade duration in ms
398398

399399
WLED_GLOBAL uint_fast16_t briMultiplier _INIT(100); // % of brightness to set (to limit power, if you set it to 50 and set bri to 255, actual brightness will be 127)

0 commit comments

Comments
 (0)