Explicit JSON flag for loading FX defaults

Disable watchdog by default
This commit is contained in:
cschwinne 2022-08-22 01:17:10 +02:00
parent 8744b40dc5
commit 844bef9fda
9 changed files with 3030 additions and 3044 deletions

View File

@ -3,5 +3,8 @@
// for the documentation about the extensions.json format // for the documentation about the extensions.json format
"recommendations": [ "recommendations": [
"platformio.platformio-ide" "platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
] ]
} }

View File

@ -326,7 +326,7 @@ board = esp32dev
platform = ${esp32.platform} platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages} platform_packages = ${esp32.platform_packages}
build_unflags = ${common.build_unflags} build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 -D WLED_WATCHDOG_TIMEOUT=0 #-D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 #-D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET
lib_deps = ${esp32.lib_deps} lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions} board_build.partitions = ${esp32.default_partitions}
@ -336,7 +336,7 @@ board = esp32dev
platform = ${esp32.platform} platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages} platform_packages = ${esp32.platform_packages}
build_unflags = ${common.build_unflags} build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 -D WLED_WATCHDOG_TIMEOUT=0 #-D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_qio80 #-D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET
lib_deps = ${esp32.lib_deps} lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions} board_build.partitions = ${esp32.default_partitions}
@ -349,7 +349,7 @@ platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages} platform_packages = ${esp32.platform_packages}
upload_speed = 921600 upload_speed = 921600
build_unflags = ${common.build_unflags} build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 -D WLED_DISABLE_BLYNK -D WLED_WATCHDOG_TIMEOUT=0 build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 -D WLED_DISABLE_BLYNK
lib_deps = ${esp32.lib_deps} lib_deps = ${esp32.lib_deps}
board_build.partitions = ${esp32.default_partitions} board_build.partitions = ${esp32.default_partitions}

View File

@ -822,7 +822,7 @@ function populateEffects()
}); });
for (let ef of effects) { for (let ef of effects) {
// WLEDSR: add slider and color control to setX (used by requestjson) // WLEDSR: add slider and color control to setFX (used by requestjson)
let id = ef.id; let id = ef.id;
let nm = ef.name+" "; let nm = ef.name+" ";
let fd = ""; let fd = "";
@ -841,7 +841,7 @@ function populateEffects()
if (r.substring(0,2)=="fr") nm += "♫"; // frequency effects if (r.substring(0,2)=="fr") nm += "♫"; // frequency effects
} }
} }
html += generateListItemHtml('fx',id,nm,'setX','',fd); html += generateListItemHtml('fx',id,nm,'setFX','',fd);
} }
} }
@ -1388,7 +1388,7 @@ function setEffectParameters(idx)
let top = parseInt(getComputedStyle(gId("sliders")).height); let top = parseInt(getComputedStyle(gId("sliders")).height);
top += 5; top += 5;
let sel = d.querySelector('#fxlist .selected'); let sel = d.querySelector('#fxlist .selected');
if (sel) sel.style.bottom = top + "px"; // we will need to remove this when unselected (in setX()) if (sel) sel.style.bottom = top + "px"; // we will need to remove this when unselected (in setFX())
},750); },750);
// set html color items on/off // set html color items on/off
var cslLabel = ''; var cslLabel = '';
@ -2069,24 +2069,15 @@ function tglFreeze(s=null)
requestJson(obj); requestJson(obj);
} }
function setX(ind = null) function setFX(ind = null)
{ {
if (ind === null) { if (ind === null) {
ind = parseInt(d.querySelector('#fxlist input[name="fx"]:checked').value); ind = parseInt(d.querySelector('#fxlist input[name="fx"]:checked').value);
} else { } else {
d.querySelector(`#fxlist input[name="fx"][value="${ind}"]`).checked = true; d.querySelector(`#fxlist input[name="fx"][value="${ind}"]`).checked = true;
} }
/*
// this code also in updateSelectedFx
var selElement = d.querySelector('#fxlist .selected');
if (selElement) {
selElement.classList.remove('selected');
selElement.style.bottom = null; // remove element style added in slider handling
}
d.querySelector(`#fxlist .lstI[data-id="${ind}"]`).classList.add('selected'); var obj = {"seg": {"fx": parseInt(ind),"fxdef":1}}; // fxdef sets effect parameters to default values, TODO add client setting
*/
var obj = {"seg": {"fx": parseInt(ind)}};
requestJson(obj); requestJson(obj);
} }
@ -2097,13 +2088,7 @@ function setPalette(paletteId = null)
} else { } else {
d.querySelector(`#pallist input[name="palette"][value="${paletteId}"]`).checked = true; d.querySelector(`#pallist input[name="palette"][value="${paletteId}"]`).checked = true;
} }
/*
var selElement = d.querySelector('#pallist .selected');
if (selElement) {
selElement.classList.remove('selected')
}
d.querySelector(`#pallist .lstI[data-id="${paletteId}"]`).classList.add('selected');
*/
var obj = {"seg": {"pal": paletteId}}; var obj = {"seg": {"pal": paletteId}};
requestJson(obj); requestJson(obj);
} }

View File

@ -211,7 +211,7 @@
<i class="icons search-icon">&#xe0a1;</i> <i class="icons search-icon">&#xe0a1;</i>
</div> </div>
<div id="fxlist" class="list"> <div id="fxlist" class="list">
<div class="lstI" data-id="0" onClick="setX(0)"><a href="#0" onClick="setX(0)">Solid</a></div> <div class="lstI" data-id="0" onClick="setEffect(0)"><a href="#0" onClick="setEffect(0)">Solid</a></div>
</div> </div>
</div> </div>
<div id="palDropdown" class="dd-content"> <div id="palDropdown" class="dd-content">

View File

@ -1124,7 +1124,7 @@ function setSegBri(s)
function setEffect(ind = 0) function setEffect(ind = 0)
{ {
tglFxDropdown(); tglFxDropdown();
var obj = {"seg": {"fx": parseInt(ind)}}; var obj = {"seg": {"fx": parseInt(ind), "fxdef":true}}; // fxdef sets effect parameters to default values, TODO add client setting
requestJson(obj); requestJson(obj);
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -178,34 +178,29 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
seg.startTransition(strip.getTransition()); // set effect transitions seg.startTransition(strip.getTransition()); // set effect transitions
//seg.markForReset(); //seg.markForReset();
seg.mode = fx; seg.mode = fx;
// load default values from effect string if effect is selected without }
// any other effect parameter (i.e. effect clicked in UI) }
if ( elem[F("sx")].isNull()
&& elem[F("ix")].isNull() // load default values from effect string
&& elem["pal"].isNull() if (elem[F("fxdef")])
&& elem[F("c1")].isNull() {
&& elem[F("c2")].isNull() int16_t sOpt;
&& elem[F("c3")].isNull() ) sOpt = extractModeDefaults(fx, SET_F("sx")); if (sOpt >= 0) seg.speed = sOpt;
{ sOpt = extractModeDefaults(fx, SET_F("ix")); if (sOpt >= 0) seg.intensity = sOpt;
int16_t sOpt; sOpt = extractModeDefaults(fx, SET_F("c1")); if (sOpt >= 0) seg.custom1 = sOpt;
sOpt = extractModeDefaults(fx, SET_F("sx")); if (sOpt >= 0) seg.speed = sOpt; sOpt = extractModeDefaults(fx, SET_F("c2")); if (sOpt >= 0) seg.custom2 = sOpt;
sOpt = extractModeDefaults(fx, SET_F("ix")); if (sOpt >= 0) seg.intensity = sOpt; sOpt = extractModeDefaults(fx, SET_F("c3")); if (sOpt >= 0) seg.custom3 = sOpt;
sOpt = extractModeDefaults(fx, SET_F("c1")); if (sOpt >= 0) seg.custom1 = sOpt; sOpt = extractModeDefaults(fx, SET_F("mp12")); if (sOpt >= 0) seg.map1D2D = sOpt & 0x07;
sOpt = extractModeDefaults(fx, SET_F("c2")); if (sOpt >= 0) seg.custom2 = sOpt; sOpt = extractModeDefaults(fx, SET_F("ssim")); if (sOpt >= 0) seg.soundSim = sOpt & 0x03;
sOpt = extractModeDefaults(fx, SET_F("c3")); if (sOpt >= 0) seg.custom3 = sOpt; sOpt = extractModeDefaults(fx, "rev"); if (sOpt >= 0) seg.reverse = (bool)sOpt;
sOpt = extractModeDefaults(fx, SET_F("mp12")); if (sOpt >= 0) seg.map1D2D = sOpt & 0x07; sOpt = extractModeDefaults(fx, SET_F("mi")); if (sOpt >= 0) seg.mirror = (bool)sOpt; // NOTE: setting this option is a risky business
sOpt = extractModeDefaults(fx, SET_F("ssim")); if (sOpt >= 0) seg.soundSim = sOpt & 0x03; sOpt = extractModeDefaults(fx, SET_F("rY")); if (sOpt >= 0) seg.reverse_y = (bool)sOpt;
sOpt = extractModeDefaults(fx, "rev"); if (sOpt >= 0) seg.reverse = (bool)sOpt; sOpt = extractModeDefaults(fx, SET_F("mY")); if (sOpt >= 0) seg.mirror_y = (bool)sOpt; // NOTE: setting this option is a risky business
sOpt = extractModeDefaults(fx, SET_F("mi")); if (sOpt >= 0) seg.mirror = (bool)sOpt; // NOTE: setting this option is a risky business sOpt = extractModeDefaults(fx, "pal");
sOpt = extractModeDefaults(fx, SET_F("rY")); if (sOpt >= 0) seg.reverse_y = (bool)sOpt; if (sOpt >= 0 && sOpt < strip.getPaletteCount() + strip.customPalettes.size()) {
sOpt = extractModeDefaults(fx, SET_F("mY")); if (sOpt >= 0) seg.mirror_y = (bool)sOpt; // NOTE: setting this option is a risky business if (sOpt != seg.palette) {
sOpt = extractModeDefaults(fx, "pal"); if (strip.paletteFade && !seg.transitional) seg.startTransition(strip.getTransition());
if (sOpt >= 0 && sOpt < strip.getPaletteCount() + strip.customPalettes.size()) { seg.palette = sOpt;
if (sOpt != seg.palette) {
if (strip.paletteFade && !seg.transitional) seg.startTransition(strip.getTransition());
seg.palette = sOpt;
}
}
} }
} }
} }

View File

@ -8,7 +8,7 @@
*/ */
// version code in format yymmddb (b = daily build) // version code in format yymmddb (b = daily build)
#define VERSION 2208180 #define VERSION 2208220
//uncomment this if you have a "my_config.h" file you'd like to use //uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG //#define WLED_USE_MY_CONFIG
@ -51,8 +51,8 @@
#ifndef WLED_WATCHDOG_TIMEOUT #ifndef WLED_WATCHDOG_TIMEOUT
// 3 seconds should be enough to detect a lockup // 3 seconds should be enough to detect a lockup
// define WLED_WATCHDOG_TIMEOUT=0 to disable watchdog // define WLED_WATCHDOG_TIMEOUT=0 to disable watchdog, default
#define WLED_WATCHDOG_TIMEOUT 3 #define WLED_WATCHDOG_TIMEOUT 0
#endif #endif
//optionally disable brownout detector on ESP32. //optionally disable brownout detector on ESP32.