Skip to content

Commit

Permalink
0.13.0-b3
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Sep 21, 2021
1 parent f2043dc commit 96422de
Show file tree
Hide file tree
Showing 13 changed files with 811 additions and 796 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
26 changes: 15 additions & 11 deletions wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions wled00/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ function populateSegments(s)
</label>
<div class="segname">
<div class="segntxt" onclick="selSegEx(${i})">${inst.n ? inst.n : "Segment "+i}</div>
<i class="icons edit-icon" id="seg${i}nedit" onclick="tglSegn(${i})">&#xe2c6;</i>
<i class="icons edit-icon ${expanded[i] ? "expanded":""}" id="seg${i}nedit" onclick="tglSegn(${i})">&#xe2c6;</i>
</div>
<i class="icons e-icon flr ${expanded[i] ? "exp":""}" id="sege${i}" onclick="expand(${i})">&#xe395;</i>
<div class="segin ${expanded[i] ? "expanded":""}" id="seg${i}">
Expand Down Expand Up @@ -1260,7 +1260,7 @@ function makeSeg() {
var cn = `<div class="seg">
<div class="segname newseg">
New segment ${lowestUnused}
<i class="icons edit-icon" style="display: inline;" onclick="tglSegn(${lowestUnused})">&#xe2c6;</i>
<i class="icons edit-icon expanded" onclick="tglSegn(${lowestUnused})">&#xe2c6;</i>
</div>
<br>
<div class="segin expanded">
Expand Down
2 changes: 1 addition & 1 deletion wled00/data/settings_leds.htm
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
}
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();
Expand Down
2 changes: 1 addition & 1 deletion wled00/data/settings_sec.htm
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion wled00/data/settings_ui.htm
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion wled00/html_other.h
Original file line number Diff line number Diff line change
Expand Up @@ -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}
</style></head><body><h2>WLED Software Update</h2><form method="POST"
action="/update" id="uf" enctype="multipart/form-data" onsubmit="U()">
Installed version: 0.13.0-b2<br>Download the latest binary: <a
Installed version: 0.13.0-b3<br>Download the latest binary: <a
href="https://github.com/Aircoookie/WLED/releases" target="_blank"><img
src="https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square">
</a><br><input type="file" class="bt" name="update" required><br><input
Expand Down
8 changes: 4 additions & 4 deletions wled00/html_settings.h

Large diffs are not rendered by default.

Loading

0 comments on commit 96422de

Please sign in to comment.