Merge branch 'master' into ledmap-multisegment-fix

This commit is contained in:
Blaž Kristan 2021-04-05 21:19:19 +02:00 committed by GitHub
commit 2d55056015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 706 additions and 724 deletions

View File

@ -1,7 +1,27 @@
## WLED changelog ## WLED changelog
### Builds after release 0.12.0
#### Build 2104030
- Fixed ESP32 crash on Drip effect with reversed segment (#1854)
- Added flag `WLED_DISABLE_BROWNOUT_DET` to disable ESP32 brownout detector (off by default)
### WLED release 0.12.0
#### Build 2104020
- Allow clearing button/IR/relay pin on platforms that don't support negative numbers
- Removed AUX pin
- Hid some easter eggs, only to be found at easter
### Development versions between 0.11.1 and 0.12.0 releases ### Development versions between 0.11.1 and 0.12.0 releases
#### Build 2103310
- Version bump to 0.12.0 "Hikari"
- Fixed LED settings submission in iOS app
#### Build 2103300 #### Build 2103300
- Version bump to 0.12.0-b5 "Hikari" - Version bump to 0.12.0-b5 "Hikari"

View File

@ -1,6 +1,6 @@
{ {
"name": "wled", "name": "wled",
"version": "0.12.0-b5", "version": "0.12.0",
"description": "Tools for WLED project", "description": "Tools for WLED project",
"main": "tools/cdata.js", "main": "tools/cdata.js",
"directories": { "directories": {

View File

@ -21,6 +21,7 @@ A fast and feature-rich implementation of an ESP8266/ESP32 webserver to control
- Segments to set different effects and colors to parts of the LEDs - Segments to set different effects and colors to parts of the LEDs
- Settings page - configuration over network - Settings page - configuration over network
- Access Point and station mode - automatic failsafe AP - Access Point and station mode - automatic failsafe AP
- Up to 10 LED outputs per instance
- Support for RGBW strips - Support for RGBW strips
- Up to 250 user presets to save and load colors/effects easily, supports cycling through them. - Up to 250 user presets to save and load colors/effects easily, supports cycling through them.
- Presets can be used to automatically execute API calls - Presets can be used to automatically execute API calls

View File

@ -39,7 +39,7 @@ default_envs = d1_mini
... ...
[common] [common]
... ...
lib_deps_external = lib_deps =
... ...
#For use SSD1306 OLED display uncomment following #For use SSD1306 OLED display uncomment following
U8g2@~2.27.3 U8g2@~2.27.3
@ -55,4 +55,4 @@ lib_deps_external =
* Changed to use async, non-blocking implementation * Changed to use async, non-blocking implementation
* Do not report low temperatures that indicate an error to mqtt * Do not report low temperatures that indicate an error to mqtt
* Disable plugin if temperature sensor not detected * Disable plugin if temperature sensor not detected
* Report the number of seconds until the first read in the info screen instead of sensor error * Report the number of seconds until the first read in the info screen instead of sensor error

View File

@ -3081,7 +3081,7 @@ uint16_t WS2812FX::mode_drip(void)
gravity *= SEGLEN; gravity *= SEGLEN;
int sourcedrop = 12; int sourcedrop = 12;
for (int j=0;j<numDrops;j++) { for (uint8_t j=0;j<numDrops;j++) {
if (drops[j].colIndex == 0) { //init if (drops[j].colIndex == 0) { //init
drops[j].pos = SEGLEN-1; // start at end drops[j].pos = SEGLEN-1; // start at end
drops[j].vel = 0; // speed drops[j].vel = 0; // speed
@ -3092,7 +3092,7 @@ uint16_t WS2812FX::mode_drip(void)
setPixelColor(SEGLEN-1,color_blend(BLACK,SEGCOLOR(0), sourcedrop));// water source setPixelColor(SEGLEN-1,color_blend(BLACK,SEGCOLOR(0), sourcedrop));// water source
if (drops[j].colIndex==1) { if (drops[j].colIndex==1) {
if (drops[j].col>255) drops[j].col=255; if (drops[j].col>255) drops[j].col=255;
setPixelColor(int(drops[j].pos),color_blend(BLACK,SEGCOLOR(0),drops[j].col)); setPixelColor(uint16_t(drops[j].pos),color_blend(BLACK,SEGCOLOR(0),drops[j].col));
drops[j].col += map(SEGMENT.speed, 0, 255, 1, 6); // swelling drops[j].col += map(SEGMENT.speed, 0, 255, 1, 6); // swelling
@ -3107,8 +3107,9 @@ uint16_t WS2812FX::mode_drip(void)
if (drops[j].pos < 0) drops[j].pos = 0; if (drops[j].pos < 0) drops[j].pos = 0;
drops[j].vel += gravity; drops[j].vel += gravity;
for (int i=1;i<7-drops[j].colIndex;i++) { // some minor math so we don't expand bouncing droplets for (uint16_t i=1;i<7-drops[j].colIndex;i++) { // some minor math so we don't expand bouncing droplets
setPixelColor(int(drops[j].pos)+i,color_blend(BLACK,SEGCOLOR(0),drops[j].col/i)); //spread pixel with fade while falling uint16_t pos = uint16_t(drops[j].pos) +i; //this is BAD, returns a pos >= SEGLEN occasionally
setPixelColor(pos,color_blend(BLACK,SEGCOLOR(0),drops[j].col/i)); //spread pixel with fade while falling
} }
if (drops[j].colIndex > 2) { // during bounce, some water is on the floor if (drops[j].colIndex > 2) { // during bounce, some water is on the floor

View File

@ -105,31 +105,4 @@ void handleIO()
} }
offMode = true; offMode = true;
} }
//output
if (auxPin>=1 && (auxActive || auxActiveBefore))
{
if (!auxActiveBefore)
{
auxActiveBefore = true;
switch (auxTriggeredState)
{
case 0: pinMode(auxPin, INPUT); break;
case 1: pinMode(auxPin, OUTPUT); digitalWrite(auxPin, HIGH); break;
case 2: pinMode(auxPin, OUTPUT); digitalWrite(auxPin, LOW); break;
}
auxStartTime = millis();
}
if ((millis() - auxStartTime > auxTime*1000 && auxTime != 255) || !auxActive)
{
auxActive = false;
auxActiveBefore = false;
switch (auxDefaultState)
{
case 0: pinMode(auxPin, INPUT); break;
case 1: pinMode(auxPin, OUTPUT); digitalWrite(auxPin, HIGH); break;
case 2: pinMode(auxPin, OUTPUT); digitalWrite(auxPin, LOW); break;
}
}
}
} }

View File

@ -500,9 +500,6 @@ void serializeConfig() {
//JsonObject hw_status = hw.createNestedObject("status"); //JsonObject hw_status = hw.createNestedObject("status");
//hw_status["pin"] = -1; //hw_status["pin"] = -1;
JsonObject hw_aux = hw.createNestedObject("aux");
hw_aux["pin"] = auxPin;
JsonObject light = doc.createNestedObject(F("light")); JsonObject light = doc.createNestedObject(F("light"));
light[F("scale-bri")] = briMultiplier; light[F("scale-bri")] = briMultiplier;
light[F("pal-mode")] = strip.paletteBlend; light[F("pal-mode")] = strip.paletteBlend;

View File

@ -156,6 +156,7 @@ function loadBg(iUrl) {
if (iUrl == "") { if (iUrl == "") {
var today = new Date(); var today = new Date();
if (today.getMonth() == 11 && (today.getDate() > 23 && today.getDate() < 28)) img.src = "https://aircoookie.github.io/xmas.png"; if (today.getMonth() == 11 && (today.getDate() > 23 && today.getDate() < 28)) img.src = "https://aircoookie.github.io/xmas.png";
else if (today.getMonth() == 3 && (today.getDate() > 3 && today.getDate() < 6)) img.src = "https://aircoookie.github.io/easter.png";
} }
img.addEventListener('load', (event) => { img.addEventListener('load', (event) => {
var a = parseFloat(cfg.theme.alpha.bg); var a = parseFloat(cfg.theme.alpha.bg);

View File

@ -14,10 +14,14 @@
{ {
window.open("/settings","_self"); window.open("/settings","_self");
} }
function off(n){
d.getElementsByName(n)[0].value = -1;
}
function bLimits(b,p,m) { function bLimits(b,p,m) {
maxB = b; maxM = m; maxPB = p; maxB = b; maxM = m; maxPB = p;
} }
function trySubmit() { function trySubmit(event) {
event.preventDefault();
var LCs = d.getElementsByTagName("input"); var LCs = d.getElementsByTagName("input");
for (i=0; i<LCs.length; i++) { for (i=0; i<LCs.length; i++) {
var nm = LCs[i].name.substring(0,2); var nm = LCs[i].name.substring(0,2);
@ -36,6 +40,7 @@
} }
} }
if (bquot > 100) {var msg = "Too many LEDs for me to handle!"; if (maxM < 10000) msg += " Consider using an ESP32."; alert(msg); return;} if (bquot > 100) {var msg = "Too many LEDs for me to handle!"; if (maxM < 10000) msg += " Consider using an ESP32."; alert(msg); return;}
if (d.Sf.checkValidity()) d.Sf.submit(); //https://stackoverflow.com/q/37323914
if (d.Sf.reportValidity()) d.Sf.submit(); if (d.Sf.reportValidity()) d.Sf.submit();
} }
function S(){GetV();setABL();} function S(){GetV();setABL();}
@ -255,9 +260,9 @@
</style> </style>
</head> </head>
<body onload="S()"> <body onload="S()">
<form id="form_s" name="Sf" method="post"> <form id="form_s" name="Sf" method="post" onsubmit="trySubmit(event)">
<div class="helpB"><button type="button" onclick="H()">?</button></div> <div class="helpB"><button type="button" onclick="H()">?</button></div>
<button type="button" onclick="B()">Back</button><button type="button" onclick="trySubmit()">Save</button><hr> <button type="button" onclick="B()">Back</button><button type="submit">Save</button><hr>
<h2>LED &amp; Hardware setup</h2> <h2>LED &amp; Hardware setup</h2>
Total LED count: <input name="LC" type="number" min="1" max="8192" oninput="UI()" required><br> Total LED count: <input name="LC" type="number" min="1" max="8192" oninput="UI()" required><br>
<i>Recommended power supply for brightest white:</i><br> <i>Recommended power supply for brightest white:</i><br>
@ -297,11 +302,11 @@
<div id="ledwarning" style="color: orange; display: none;"> <div id="ledwarning" style="color: orange; display: none;">
&#9888; You might run into stability or lag issues.<br> &#9888; You might run into stability or lag issues.<br>
Use less than <span id="wreason">800 LEDs per pin</span> for the best experience!<br> Use less than <span id="wreason">800 LEDs per pin</span> for the best experience!<br>
</div><br> </div>
Relay pin: <input type="number" min="-1" max="40" name="RL" onchange="UI()"> Active high <input type="checkbox" name="RM"><br> Button pin: <input type="number" min="-1" max="40" name="BT" onchange="UI()"><span style="cursor: pointer;" onclick="off('BT')">&nbsp;&#215;</span><br>
Button pin: <input type="number" min="-1" max="40" name="BT" onchange="UI()"><br> IR pin: <input type="number" min="-1" max="40" name="IR" onchange="UI()"><span style="cursor: pointer;" onclick="off('IR')">&nbsp;&#215;</span><br>
IR pin: <input type="number" min="-1" max="40" name="IR" onchange="UI()"><br> Relay pin: <input type="number" min="-1" max="40" name="RL" onchange="UI()"><span style="cursor: pointer;" onclick="off('RL')">&nbsp;&#215;</span><br>
AUX pin: <input type="number" min="-1" max="40" name="AX" onchange="UI()"> Active high <input type="checkbox" name="RM">
<h3>Defaults</h3> <h3>Defaults</h3>
Turn LEDs on after power up/reset: <input type="checkbox" name="BO"><br> Turn LEDs on after power up/reset: <input type="checkbox" name="BO"><br>
Default brightness: <input name="CA" type="number" min="0" max="255" required> (0-255)<br><br> Default brightness: <input name="CA" type="number" min="0" max="255" required> (0-255)<br><br>
@ -344,7 +349,7 @@
<option value=4>Legacy</option> <option value=4>Legacy</option>
</select> </select>
<br></span><hr> <br></span><hr>
<button type="button" onclick="B()">Back</button><button type="button" onclick="trySubmit()">Save</button> <button type="button" onclick="B()">Back</button><button type="submit">Save</button>
</form> </form>
</body> </body>
</html> </html>

View File

@ -18,6 +18,7 @@ button {
font-size: 20px; font-size: 20px;
margin: 8px; margin: 8px;
margin-top: 12px; margin-top: 12px;
cursor: pointer;
} }
.helpB { .helpB {
text-align: left; text-align: left;

View File

@ -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} .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" </style></head><body><h2>WLED Software Update</h2><form method="POST"
action="/update" id="uf" enctype="multipart/form-data" onsubmit="U()"> action="/update" id="uf" enctype="multipart/form-data" onsubmit="U()">
Installed version: 0.12.0-b5<br>Download the latest binary: <a Installed version: 0.12.0<br>Download the latest binary: <a
href="https://github.com/Aircoookie/WLED/releases" target="_blank"><img href="https://github.com/Aircoookie/WLED/releases" target="_blank"><img
src="https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square"> 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> </a><br><input type="file" class="bt" name="update" accept=".bin" required><br>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -153,13 +153,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
btnPin = -1; btnPin = -1;
} }
int hw_aux_pin = request->arg(F("AX")).toInt();
if (pinManager.allocatePin(hw_aux_pin,true)) {
auxPin = hw_aux_pin;
} else {
auxPin = -1;
}
strip.ablMilliampsMax = request->arg(F("MA")).toInt(); strip.ablMilliampsMax = request->arg(F("MA")).toInt();
strip.milliampsPerLed = request->arg(F("LA")).toInt(); strip.milliampsPerLed = request->arg(F("LA")).toInt();
@ -722,16 +715,6 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
} }
if (nightlightMode > NL_MODE_SUN) nightlightMode = NL_MODE_SUN; if (nightlightMode > NL_MODE_SUN) nightlightMode = NL_MODE_SUN;
//toggle general purpose output
if (auxPin>=0) {
pos = req.indexOf(F("AX="));
if (pos > 0) {
auxTime = getNumVal(&req, pos);
auxActive = true;
if (auxTime == 0) auxActive = false;
}
}
pos = req.indexOf(F("TT=")); pos = req.indexOf(F("TT="));
if (pos > 0) transitionDelay = getNumVal(&req, pos); if (pos > 0) transitionDelay = getNumVal(&req, pos);

View File

@ -2,6 +2,11 @@
#include "wled.h" #include "wled.h"
#include <Arduino.h> #include <Arduino.h>
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_DISABLE_BROWNOUT_DET)
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
#endif
/* /*
* Main WLED class implementation. Mostly initialization and connection logic * Main WLED class implementation. Mostly initialization and connection logic
*/ */
@ -285,6 +290,10 @@ void WLED::loop()
void WLED::setup() void WLED::setup()
{ {
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_DISABLE_BROWNOUT_DET)
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detection
#endif
Serial.begin(115200); Serial.begin(115200);
Serial.setTimeout(50); Serial.setTimeout(50);
DEBUG_PRINTLN(); DEBUG_PRINTLN();
@ -337,8 +346,6 @@ void WLED::setup()
pinMode(STATUSLED, OUTPUT); pinMode(STATUSLED, OUTPUT);
#endif #endif
//DEBUG_PRINTLN(F("Load EEPROM"));
//loadSettingsFromEEPROM();
beginStrip(); beginStrip();
userSetup(); userSetup();
usermods.setup(); usermods.setup();

View File

@ -3,12 +3,12 @@
/* /*
Main sketch, global variable declarations Main sketch, global variable declarations
@title WLED project sketch @title WLED project sketch
@version 0.12.0-b5 @version 0.12.0
@author Christian Schwinne @author Christian Schwinne
*/ */
// version code in format yymmddb (b = daily build) // version code in format yymmddb (b = daily build)
#define VERSION 2103300 #define VERSION 2104030
//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
@ -16,8 +16,8 @@
// ESP8266-01 (blue) got too little storage space to work with WLED. 0.10.2 is the last release supporting this unit. // ESP8266-01 (blue) got too little storage space to work with WLED. 0.10.2 is the last release supporting this unit.
// ESP8266-01 (black) has 1MB flash and can thus fit the whole program, although OTA update is not possible. Use 1M(128K SPIFFS). // ESP8266-01 (black) has 1MB flash and can thus fit the whole program, although OTA update is not possible. Use 1M(128K SPIFFS).
// Uncomment some of the following lines to disable features to compile for ESP8266-01 (max flash size 434kB): // Uncomment some of the following lines to disable features:
// Alternatively, with platformio pass your chosen flags to your custom build target in platformio.ini.override // Alternatively, with platformio pass your chosen flags to your custom build target in platformio_override.ini
// You are required to disable over-the-air updates: // You are required to disable over-the-air updates:
//#define WLED_DISABLE_OTA // saves 14kb //#define WLED_DISABLE_OTA // saves 14kb
@ -47,6 +47,10 @@
// filesystem specific debugging // filesystem specific debugging
//#define WLED_DEBUG_FS //#define WLED_DEBUG_FS
//optionally disable brownout detector on ESP32.
//This is generally a terrible idea, but improves boot success on boards with a 3.3v regulator + cap setup that can't provide 400mA peaks
//#define WLED_DISABLE_BROWNOUT_DET
// Library inclusions. // Library inclusions.
#include <Arduino.h> #include <Arduino.h>
#ifdef ESP8266 #ifdef ESP8266
@ -168,7 +172,7 @@
#endif #endif
// Global Variable definitions // Global Variable definitions
WLED_GLOBAL char versionString[] _INIT("0.12.0-b5"); WLED_GLOBAL char versionString[] _INIT("0.12.0");
#define WLED_CODENAME "Hikari" #define WLED_CODENAME "Hikari"
// AP and OTA default passwords (for maximum security change them!) // AP and OTA default passwords (for maximum security change them!)
@ -481,19 +485,6 @@ WLED_GLOBAL unsigned long lastInterfaceUpdate _INIT(0);
WLED_GLOBAL byte interfaceUpdateCallMode _INIT(NOTIFIER_CALL_MODE_INIT); WLED_GLOBAL byte interfaceUpdateCallMode _INIT(NOTIFIER_CALL_MODE_INIT);
WLED_GLOBAL char mqttStatusTopic[40] _INIT(""); // this must be global because of async handlers WLED_GLOBAL char mqttStatusTopic[40] _INIT(""); // this must be global because of async handlers
// auxiliary debug pin
#ifndef AUXPIN
WLED_GLOBAL int8_t auxPin _INIT(-1);
#else
WLED_GLOBAL int8_t auxPin _INIT(AUXPIN);
#endif
WLED_GLOBAL byte auxTime _INIT(0);
WLED_GLOBAL unsigned long auxStartTime _INIT(0);
WLED_GLOBAL bool auxActive _INIT(false);
WLED_GLOBAL bool auxActiveBefore _INIT(false);
WLED_GLOBAL byte auxDefaultState _INIT(0); // 0: input 1: high 2: low
WLED_GLOBAL byte auxTriggeredState _INIT(0); // 0: input 1: high 2: low
// alexa udp // alexa udp
WLED_GLOBAL String escapedMac; WLED_GLOBAL String escapedMac;
#ifndef WLED_DISABLE_ALEXA #ifndef WLED_DISABLE_ALEXA

View File

@ -339,7 +339,6 @@ void getSettingsJS(byte subPage, char* dest)
sappend('c',SET_F("RM"),rlyMde); sappend('c',SET_F("RM"),rlyMde);
sappend('v',SET_F("BT"),btnPin); sappend('v',SET_F("BT"),btnPin);
sappend('v',SET_F("IR"),irPin); sappend('v',SET_F("IR"),irPin);
sappend('v',SET_F("AX"),auxPin);
} }
if (subPage == 3) if (subPage == 3)