WLEDMM: we need the same delay when initially switching the relay on

This commit is contained in:
Frank
2025-01-09 23:51:03 +01:00
parent f4061e671b
commit c0d8e256ae
2 changed files with 6 additions and 2 deletions

View File

@@ -896,6 +896,7 @@ void WLED::beginStrip()
strip.finalizeInit(); // busses created during deserializeConfig() strip.finalizeInit(); // busses created during deserializeConfig()
strip.makeAutoSegments(); strip.makeAutoSegments();
strip.setBrightness(0); strip.setBrightness(0);
strip.fill(BLACK); // WLEDMM avoids random colors at power-on
strip.setShowCallback(handleOverlayDraw); strip.setShowCallback(handleOverlayDraw);
if (turnOnAtBoot) { if (turnOnAtBoot) {
@@ -913,8 +914,11 @@ void WLED::beginStrip()
colorUpdated(CALL_MODE_INIT); colorUpdated(CALL_MODE_INIT);
// init relay pin // init relay pin
if (rlyPin>=0) if (rlyPin>=0) {
delay(FRAMETIME_FIXED); // WLEDMM wait a bit, to ensure that no background led communication is happening while powering on the strip
digitalWrite(rlyPin, (rlyMde ? bri : !bri)); digitalWrite(rlyPin, (rlyMde ? bri : !bri));
delay(50); // wait for relay to switch and power to stabilize
}
} }
void WLED::initAP(bool resetAP) void WLED::initAP(bool resetAP)

View File

@@ -7,7 +7,7 @@
*/ */
// version code in format yymmddb (b = daily build) // version code in format yymmddb (b = daily build)
#define VERSION 2501070 #define VERSION 2501090
// 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. // 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.
#define _MoonModules_WLED_ #define _MoonModules_WLED_