From 96422de0316fe07ae23458893dd2b325a7ccf687 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Tue, 21 Sep 2021 23:37:35 +0200 Subject: [PATCH] 0.13.0-b3 --- CHANGELOG.md | 9 +- package-lock.json | 2 +- package.json | 2 +- wled00/FX.h | 26 +- wled00/data/index.js | 4 +- wled00/data/settings_leds.htm | 2 +- wled00/data/settings_sec.htm | 2 +- wled00/data/settings_ui.htm | 2 +- wled00/html_other.h | 2 +- wled00/html_settings.h | 8 +- wled00/html_ui.h | 1540 ++++++++++++++++----------------- wled00/wled.h | 4 +- wled00/wled_server.cpp | 4 + 13 files changed, 811 insertions(+), 796 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c53b653f1..baa1e3074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,18 @@ ### Builds after release 0.12.0 -#### Build 2109200 +#### Build 2109220 +- Version bump to 0.13.0-b3 "Toki" - Added segment names (PR #2184) - Improved Police and other effects (PR #2184) - Reverted PR #1902 (Live color correction - will be implemented as usermod) (PR #2175) +- Added transitions for segment on/off +- Improved number of sparks/stars in Fireworks effect with low number of segments +- Fixed segment name edit pencil disappearing with request +- Fixed color transition active even if the segment is off +- Disallowed file upload with OTA lock active +- Fixed analog invert option missing (PR #2219) #### Build 2109100 diff --git a/package-lock.json b/package-lock.json index 3db771990..f02dc3035 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "wled", - "version": "0.13.0-b2", + "version": "0.13.0-b3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 980d3a218..0c8221171 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wled", - "version": "0.13.0-b2", + "version": "0.13.0-b3", "description": "Tools for WLED project", "main": "tools/cdata.js", "directories": { diff --git a/wled00/FX.h b/wled00/FX.h index ad8b7419e..19660a887 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -279,20 +279,22 @@ class WS2812FX { void setOption(uint8_t n, bool val, uint8_t segn = 255) { bool prevOn = false; - if (n == SEG_OPTION_ON) prevOn = getOption(SEG_OPTION_ON); + if (n == SEG_OPTION_ON) { + prevOn = getOption(SEG_OPTION_ON); + if (!val && prevOn) { //fade off + ColorTransition::startTransition(opacity, colors[0], instance->_transitionDur, segn, 0); + } + } + if (val) { options |= 0x01 << n; } else { options &= ~(0x01 << n); } - //transitions on segment on/off don't work correctly at this point - if (n == SEG_OPTION_ON && segn < MAX_NUM_SEGMENTS && val != prevOn) { - if (val) { - ColorTransition::startTransition(0, colors[0], instance->_transitionDur, segn, 0); - } else { - ColorTransition::startTransition(opacity, colors[0], instance->_transitionDur, segn, 0); - } + + if (n == SEG_OPTION_ON && val && !prevOn) { //fade on + ColorTransition::startTransition(0, colors[0], instance->_transitionDur, segn, 0); } } bool getOption(uint8_t n) @@ -413,6 +415,7 @@ class WS2812FX { static void startTransition(uint8_t oldBri, uint32_t oldCol, uint16_t dur, uint8_t segn, uint8_t slot) { if (segn >= MAX_NUM_SEGMENTS || slot >= NUM_COLORS || dur == 0) return; if (instance->_brightness == 0) return; //do not need transitions if master bri is off + if (!instance->_segments[segn].getOption(SEG_OPTION_ON)) return; //not if segment is off either uint8_t tIndex = 0xFF; //none found uint16_t tProgression = 0; uint8_t s = segn + (slot << 6); //merge slot and segment into one byte @@ -441,7 +444,8 @@ class WS2812FX { ColorTransition& t = instance->transitions[tIndex]; if (t.segment == s) //this is an active transition on the same segment+color { - t.briOld = t.currentBri(); + bool wasTurningOff = (oldBri == 0); + t.briOld = t.currentBri(wasTurningOff); t.colorOld = t.currentColor(oldCol); } else { t.briOld = oldBri; @@ -473,11 +477,11 @@ class WS2812FX { uint32_t currentColor(uint32_t colorNew) { return instance->color_blend(colorOld, colorNew, progress(true), true); } - uint8_t currentBri() { + uint8_t currentBri(bool turningOff = false) { uint8_t segn = segment & 0x3F; if (segn >= MAX_NUM_SEGMENTS) return 0; uint8_t briNew = instance->_segments[segn].opacity; - if (!instance->_segments[segn].getOption(SEG_OPTION_ON)) briNew = 0; //NEW + if (!instance->_segments[segn].getOption(SEG_OPTION_ON) || turningOff) briNew = 0; uint32_t prog = progress() + 1; return ((briNew * prog) + (briOld * (0x10000 - prog))) >> 16; } diff --git a/wled00/data/index.js b/wled00/data/index.js index c2467b6fe..fe3178ab2 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -580,7 +580,7 @@ function populateSegments(s)
${inst.n ? inst.n : "Segment "+i}
- +
@@ -1260,7 +1260,7 @@ function makeSeg() { var cn = `
New segment ${lowestUnused} - +

diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 70e99a17f..469c72e16 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -308,7 +308,7 @@ Color Order: } function uploadFile(name) { var req = new XMLHttpRequest(); - req.addEventListener('load', function(){showToast(this.responseText)}); + req.addEventListener('load', function(){showToast(this.responseText,this.status >= 400)}); req.addEventListener('error', function(e){showToast(e.stack,true);}); req.open("POST", "/upload"); var formData = new FormData(); diff --git a/wled00/data/settings_sec.htm b/wled00/data/settings_sec.htm index 27f36f12c..d8e8dbc81 100644 --- a/wled00/data/settings_sec.htm +++ b/wled00/data/settings_sec.htm @@ -37,7 +37,7 @@ } function uploadFile(fO,name) { var req = new XMLHttpRequest(); - req.addEventListener('load', function(){showToast(this.responseText)}); + req.addEventListener('load', function(){showToast(this.responseText,this.status >= 400)}); req.addEventListener('error', function(e){showToast(e.stack,true);}); req.open("POST", "/upload"); var formData = new FormData(); diff --git a/wled00/data/settings_ui.htm b/wled00/data/settings_ui.htm index 90bb43ece..24083b454 100644 --- a/wled00/data/settings_ui.htm +++ b/wled00/data/settings_ui.htm @@ -193,7 +193,7 @@ } function uploadFile(fO,name) { var req = new XMLHttpRequest(); - req.addEventListener('load', function(){showToast(this.responseText)}); + req.addEventListener('load', function(){showToast(this.responseText,this.status >= 400)}); req.addEventListener('error', function(e){showToast(e.stack,true);}); req.open("POST", "/upload"); var formData = new FormData(); diff --git a/wled00/html_other.h b/wled00/html_other.h index 08a3bc29c..abad5e501 100644 --- a/wled00/html_other.h +++ b/wled00/html_other.h @@ -42,7 +42,7 @@ function B(){window.history.back()}function U(){document.getElementById("uf").st .bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}input[type=file]{font-size:16px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%}#msg{display:none}

WLED Software Update

-Installed version: 0.13.0-b2
Download the latest binary: Download the latest binary:

Back
// Autogenerated from wled00/data/settings_leds.htm, do not edit!! const char PAGE_settings_leds[] PROGMEM = R"=====(LED Settings