Skip to content

Commit

Permalink
Merge pull request #1836 from Aircoookie/blackmagic
Browse files Browse the repository at this point in the history
Defeat the black magic
  • Loading branch information
Aircoookie committed Mar 29, 2021
2 parents 1f4a15e + e460782 commit 4a1ecc7
Show file tree
Hide file tree
Showing 21 changed files with 2,143 additions and 2,139 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
## WLED changelog

### Development versions after 0.11.1 release
### Development versions between 0.11.1 and 0.12.0 releases

#### Build 2103290

- Version bump to 0.12.0-b4 "Hikari"
- Experimental use of [email protected]
- Fixed RGBW mode disabled after LED settings saved
- Fixed infrared support not compiled in if IRPIN is not defined

#### Build 2103230

Expand Down Expand Up @@ -233,7 +240,7 @@
#### Build 2011153

- Fixed an ESP32 end-of-file issue
- Fixed useRGBW not read from cfg.json
- Fixed strip.isRgbw not read from cfg.json

#### Build 2011152

Expand Down
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.12.0-b2",
"version": "0.12.0-b4",
"description": "Tools for WLED project",
"main": "tools/cdata.js",
"directories": {
Expand Down
14 changes: 7 additions & 7 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ build_flags = ${common.build_flags_esp8266} -D LEDPIN=1 -D WLED_DISABLE_INFRARED

[env:esp32dev]
board = esp32dev
platform = espressif32@2.0
platform = espressif32@3.1.1
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32}
lib_ignore =
Expand All @@ -268,7 +268,7 @@ lib_ignore =

[env:esp32_eth]
board = esp32-poe
platform = espressif32@2.0
platform = espressif32@3.1.1
upload_speed = 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1
Expand Down Expand Up @@ -387,7 +387,7 @@ build_flags = ${common.build_flags_esp8266} -D USE_WS2801

[env:custom32_LEDPIN_16]
board = esp32dev
platform = espressif32@2.0
platform = espressif32@3.1.1
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D LEDPIN=16 -D RLYPIN=19
lib_ignore =
Expand All @@ -396,7 +396,7 @@ lib_ignore =

[env:custom32_APA102]
board = esp32dev
platform = espressif32@2.0
platform = espressif32@3.1.1
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D USE_APA102
lib_ignore =
Expand All @@ -405,7 +405,7 @@ lib_ignore =

[env:custom32_TOUCHPIN_T0]
board = esp32dev
platform = espressif32@2.0
platform = espressif32@3.1.1
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D TOUCHPIN=T0
lib_ignore =
Expand All @@ -414,7 +414,7 @@ lib_ignore =

[env:wemos_shield_esp32]
board = esp32dev
platform = espressif32@2.0
platform = espressif32@3.1.1
upload_port = /dev/cu.SLAB_USBtoUART
monitor_port = /dev/cu.SLAB_USBtoUART
upload_speed = 460800
Expand All @@ -431,7 +431,7 @@ build_flags = ${common.build_flags_esp32} -D LEDPIN=27 -D BTNPIN=39
lib_ignore =
ESPAsyncTCP
ESPAsyncUDP
platform = espressif32@2.0
platform = espressif32@3.1.1

[env:sp501e]
board = esp_wroom_02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default_envs = d1_mini

[env:esp32dev]
board = esp32dev
platform = espressif32@2.0
platform = espressif32@3.1.1
build_unflags = ${common.build_unflags}
build_flags =
${common.build_flags_esp32}
Expand Down
4 changes: 2 additions & 2 deletions wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ class WS2812FX {
}

void
finalizeInit(bool supportWhite, uint16_t countPixels, bool skipFirst),
finalizeInit(uint16_t countPixels, bool skipFirst),
service(void),
blur(uint8_t),
fill(uint32_t),
Expand All @@ -608,6 +608,7 @@ class WS2812FX {
setPixelSegment(uint8_t n);

bool
isRgbw = false,
gammaCorrectBri = false,
gammaCorrectCol = true,
applyToAllSelected = true,
Expand Down Expand Up @@ -813,7 +814,6 @@ class WS2812FX {
void handle_palette(void);

bool
_useRgbw = false,
_skipFirstMode,
_triggered;

Expand Down
8 changes: 3 additions & 5 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@
*/

//do not call this method from system context (network callback)
void WS2812FX::finalizeInit(bool supportWhite, uint16_t countPixels, bool skipFirst)
void WS2812FX::finalizeInit(uint16_t countPixels, bool skipFirst)
{
if (supportWhite == _useRgbw && countPixels == _length && _skipFirstMode == skipFirst) return;
RESET_RUNTIME;
_useRgbw = supportWhite;
_length = countPixels;
_skipFirstMode = skipFirst;

Expand Down Expand Up @@ -163,7 +161,7 @@ uint16_t WS2812FX::realPixelIndex(uint16_t i) {
void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w)
{
//auto calculate white channel value if enabled
if (_useRgbw) {
if (isRgbw) {
if (rgbwMode == RGBW_MODE_AUTO_BRIGHTER || (w == 0 && (rgbwMode == RGBW_MODE_DUAL || rgbwMode == RGBW_MODE_LEGACY)))
{
//white value is set to lowest RGB channel
Expand Down Expand Up @@ -278,7 +276,7 @@ void WS2812FX::show(void) {
}


if (_useRgbw) //RGBW led total output with white LEDs enabled is still 50mA, so each channel uses less
if (isRgbw) //RGBW led total output with white LEDs enabled is still 50mA, so each channel uses less
{
powerSum *= 3;
powerSum = powerSum >> 2; //same as /= 4
Expand Down
2 changes: 1 addition & 1 deletion wled00/alexa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void onAlexaChange(EspalexaDevice* dev)
if (espalexaDevice->getColorMode() == EspalexaColorMode::ct) //shade of white
{
uint16_t ct = espalexaDevice->getCt();
if (useRGBW)
if (strip.isRgbw)
{
switch (ct) { //these values empirically look good on RGBW
case 199: col[0]=255; col[1]=255; col[2]=255; col[3]=255; break;
Expand Down
8 changes: 4 additions & 4 deletions wled00/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void deserializeConfig() {

JsonArray ins = hw_led["ins"];
uint8_t s = 0; //bus iterator
useRGBW = false;
strip.isRgbw = false;
busses.removeAll();
uint32_t mem = 0;
for (JsonObject elm : ins) {
Expand Down Expand Up @@ -127,13 +127,13 @@ void deserializeConfig() {
uint8_t ledType = elm["type"] | TYPE_WS2812_RGB;
bool reversed = elm["rev"];
//RGBW mode is enabled if at least one of the strips is RGBW
useRGBW = (useRGBW || BusManager::isRgbw(ledType));
strip.isRgbw = (strip.isRgbw || BusManager::isRgbw(ledType));
s++;
BusConfig bc = BusConfig(ledType, pins, start, length, colorOrder, reversed);
mem += busses.memUsage(bc);
if (mem <= MAX_LED_MEMORY) busses.add(bc);
}
strip.finalizeInit(useRGBW, ledCount, skipFirstLed);
strip.finalizeInit(ledCount, skipFirstLed);
if (hw_led["rev"]) busses.getBus(0)->reversed = true; //set 0.11 global reversed setting for first bus

JsonObject hw_btn_ins_0 = hw[F("btn")][F("ins")][0];
Expand Down Expand Up @@ -491,7 +491,7 @@ void serializeConfig() {
if (irPin>=0) {
JsonObject hw_ir = hw.createNestedObject("ir");
hw_ir["pin"] = irPin;
hw_ir[F("type"] = irEnabled; // the byte 'irEnabled' does contain the IR-Remote Type ( 0=disabled )
hw_ir[F("type")] = irEnabled; // the byte 'irEnabled' does contain the IR-Remote Type ( 0=disabled )
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions wled00/colors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void colorHStoRGB(uint16_t hue, byte sat, byte* rgb) //hue, sat to rgb
case 4: rgb[0]=t,rgb[1]=p,rgb[2]=255;break;
case 5: rgb[0]=255,rgb[1]=p,rgb[2]=q;
}
if (useRGBW && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col);
if (strip.isRgbw && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col);
}

void colorKtoRGB(uint16_t kelvin, byte* rgb) //white spectrum to rgb, calc
Expand Down Expand Up @@ -111,7 +111,7 @@ void colorCTtoRGB(uint16_t mired, byte* rgb) //white spectrum to rgb, bins
} else {
rgb[0]=237;rgb[1]=255;rgb[2]=239;//150
}
if (useRGBW && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col);
if (strip.isRgbw && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col);
}

#ifndef WLED_DISABLE_HUESYNC
Expand Down Expand Up @@ -169,7 +169,7 @@ void colorXYtoRGB(float x, float y, byte* rgb) //coordinates to rgb (https://www
rgb[0] = 255.0*r;
rgb[1] = 255.0*g;
rgb[2] = 255.0*b;
if (useRGBW && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col);
if (strip.isRgbw && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col);
}

void colorRGBtoXY(byte* rgb, float* xy) //rgb to coordinates (https://www.developers.meethue.com/documentation/color-conversions-rgb-xy)
Expand Down
2 changes: 1 addition & 1 deletion wled00/data/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ input[type=number]::-webkit-outer-spin-button {
}

.lstI {
position: sticky;
overflow: hidden;
}

Expand All @@ -930,7 +931,6 @@ input[type=number]::-webkit-outer-spin-button {
}

.lstI.sticky, .lstI.selected {
position: sticky;
z-index: 1;
}

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.12.0-b2<br>Download the latest binary: <a
Installed version: 0.12.0-b4<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" accept=".bin" required><br>
Expand Down
2 changes: 1 addition & 1 deletion wled00/html_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ HTTP traffic is unencrypted. An attacker in the same network can intercept form
<h3>Software Update</h3><button type="button" onclick="U()">Manual OTA Update
</button><br>Enable ArduinoOTA: <input type="checkbox" name="AO"><br><h3>About
</h3><a href="https://github.com/Aircoookie/WLED/" target="_blank">WLED</a>
version 0.12.0-b2<br><br><a
version 0.12.0-b4<br><br><a
href="https://github.com/Aircoookie/WLED/wiki/Contributors-and-credits"
target="_blank">Contributors, dependencies and special thanks</a><br>
A huge thank you to everyone who helped me create WLED!<br><br>
Expand Down
Loading

0 comments on commit 4a1ecc7

Please sign in to comment.