Reduced rev:2 API use.

Changed version to 0.12.1-a0
pull/2737/head
Blaz Kristan 2021-04-08 15:46:18 +02:00
rodzic 6eafab8286
commit 9a6d709082
7 zmienionych plików z 14 dodań i 25 usunięć

Wyświetl plik

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

Wyświetl plik

@ -3075,7 +3075,7 @@ uint16_t WS2812FX::mode_drip(void)
drops[j].vel += gravity; // gravity is negative
for (uint8_t i=1;i<7-drops[j].colIndex;i++) { // some minor math so we don't expand bouncing droplets
setPixelColor(MIN(uint16_t(drops[j].pos)+i,SEGLEN-1),color_blend(BLACK,SEGCOLOR(0),drops[j].col/i)); //spread pixel with fade while falling
setPixelColor(constrain(uint16_t(drops[j].pos)+i,0,SEGLEN-1),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

Wyświetl plik

@ -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<br>Download the latest binary: <a
Installed version: 0.12.1-a0<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>

Wyświetl plik

@ -379,7 +379,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<br><br><a
version 0.12.1-a0<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>

Wyświetl plik

@ -427,6 +427,14 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
root[F("mainseg")] = strip.getMainSegmentId();
// the following is an UGLY construct that does the job
#ifdef ESP8266
// use rev:2 API if more than 12 segments on ESP8266
uint8_t tooMany = 0;
for(uint8_t i=0; i < strip.getMaxSegments(); i++) if ((strip.getSegment(i)).isActive()) tooMany++;
if (tooMany>12)
#endif
root.remove("rev"); // remove API revision if ESP32 or ESP8266 with less than 13 segments
uint8_t versionAPI = root["rev"] | 1;
JsonArray seg = root.createNestedArray("seg");

Wyświetl plik

@ -46,15 +46,6 @@ void savePreset(byte index, bool persist, const char* pname, JsonObject saveobj)
DynamicJsonDocument lDoc(JSON_BUFFER_SIZE);
sObj = lDoc.to<JsonObject>();
if (pname) sObj["n"] = pname;
#ifdef ESP8266
// use rev:2 API if more than 12 segments on ESP8266
uint8_t tooMany = 0;
for(uint8_t i=0; i < strip.getMaxSegments(); i++) if ((strip.getSegment(i)).isActive()) tooMany++;
if (tooMany>12)
#endif
sObj.remove("rev");
DEBUGFS_PRINTLN(F("Save current state"));
serializeState(sObj, true);
currentPreset = index;
@ -64,16 +55,6 @@ void savePreset(byte index, bool persist, const char* pname, JsonObject saveobj)
DEBUGFS_PRINTLN(F("Reuse recv buffer"));
sObj.remove(F("psave"));
sObj.remove(F("v"));
// the following is an UGLY construct that does the job
#ifdef ESP8266
// use rev:2 API if more than 12 segments on ESP8266
uint8_t tooMany = 0;
for(uint8_t i=0; i < strip.getMaxSegments(); i++) if ((strip.getSegment(i)).isActive()) tooMany++;
if (tooMany>12)
#endif
sObj.remove("rev");
if (!sObj["o"]) {
DEBUGFS_PRINTLN(F("Save current state"));
serializeState(sObj, true, sObj["ib"], sObj["sb"]);

Wyświetl plik

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2104071
#define VERSION 2104081
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG
@ -172,7 +172,7 @@
#endif
// Global Variable definitions
WLED_GLOBAL char versionString[] _INIT("0.12.0");
WLED_GLOBAL char versionString[] _INIT("0.12.1-a0");
#define WLED_CODENAME "Hikari"
// AP and OTA default passwords (for maximum security change them!)