mirror of
https://github.com/wled/WLED.git
synced 2025-07-22 18:26:32 +00:00
Merge branch 'master' into merge-master
This commit is contained in:
commit
2da14e5b2a
10
CHANGELOG.md
10
CHANGELOG.md
@ -2,9 +2,17 @@
|
|||||||
|
|
||||||
### Builds after release 0.12.0
|
### Builds after release 0.12.0
|
||||||
|
|
||||||
|
#### Build 2202030
|
||||||
|
|
||||||
|
- Switched to binary format for WebSockets peek (PR #2516)
|
||||||
|
- Playlist bugfix
|
||||||
|
- Added `extractModeName()` utility function
|
||||||
|
- Added serial out (PR #2517)
|
||||||
|
- Added configurable baud rate
|
||||||
|
|
||||||
#### Build 2201260
|
#### Build 2201260
|
||||||
|
|
||||||
- Initial ESP32-C3 and ESP32-S2 support (PRs #2452, )
|
- Initial ESP32-C3 and ESP32-S2 support (PRs #2452, #2454, #2502)
|
||||||
- Full segment sync (PR #2427)
|
- Full segment sync (PR #2427)
|
||||||
- Allow overriding of color order by ranges (PR #2463)
|
- Allow overriding of color order by ranges (PR #2463)
|
||||||
- Added white channel to Peek
|
- Added white channel to Peek
|
||||||
|
@ -660,8 +660,6 @@ class WS2812FX {
|
|||||||
deserializeMap(uint8_t n=0);
|
deserializeMap(uint8_t n=0);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
isRgbw = false,
|
|
||||||
isOffRefreshRequred = false, //periodic refresh is required for the strip to remain off.
|
|
||||||
gammaCorrectBri = false,
|
gammaCorrectBri = false,
|
||||||
gammaCorrectCol = true,
|
gammaCorrectCol = true,
|
||||||
applyToAllSelected = true,
|
applyToAllSelected = true,
|
||||||
@ -864,6 +862,8 @@ class WS2812FX {
|
|||||||
uint16_t _cumulativeFps = 2;
|
uint16_t _cumulativeFps = 2;
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
_isOffRefreshRequired = false, //periodic refresh is required for the strip to remain off.
|
||||||
|
_hasWhiteChannel = false,
|
||||||
_triggered;
|
_triggered;
|
||||||
|
|
||||||
mode_ptr _mode[MODE_COUNT]; // SRAM footprint: 4 bytes per element
|
mode_ptr _mode[MODE_COUNT]; // SRAM footprint: 4 bytes per element
|
||||||
@ -925,6 +925,10 @@ class WS2812FX {
|
|||||||
uint16_t
|
uint16_t
|
||||||
realPixelIndex(uint16_t i),
|
realPixelIndex(uint16_t i),
|
||||||
transitionProgress(uint8_t tNr);
|
transitionProgress(uint8_t tNr);
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline bool hasWhiteChannel(void) {return _hasWhiteChannel;}
|
||||||
|
inline bool isOffRefreshRequired(void) {return _isOffRefreshRequired;}
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const char JSON_mode_names[];
|
extern const char JSON_mode_names[];
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
void WS2812FX::finalizeInit(void)
|
void WS2812FX::finalizeInit(void)
|
||||||
{
|
{
|
||||||
RESET_RUNTIME;
|
RESET_RUNTIME;
|
||||||
isRgbw = isOffRefreshRequred = false;
|
_hasWhiteChannel = _isOffRefreshRequired = false;
|
||||||
|
|
||||||
//if busses failed to load, add default (fresh install, FS issue, ...)
|
//if busses failed to load, add default (fresh install, FS issue, ...)
|
||||||
if (busses.getNumBusses() == 0) {
|
if (busses.getNumBusses() == 0) {
|
||||||
@ -93,9 +93,9 @@ void WS2812FX::finalizeInit(void)
|
|||||||
if (bus == nullptr) continue;
|
if (bus == nullptr) continue;
|
||||||
if (bus->getStart() + bus->getLength() > MAX_LEDS) break;
|
if (bus->getStart() + bus->getLength() > MAX_LEDS) break;
|
||||||
//RGBW mode is enabled if at least one of the strips is RGBW
|
//RGBW mode is enabled if at least one of the strips is RGBW
|
||||||
isRgbw |= bus->isRgbw();
|
_hasWhiteChannel |= bus->isRgbw();
|
||||||
//refresh is required to remain off if at least one of the strips requires the refresh.
|
//refresh is required to remain off if at least one of the strips requires the refresh.
|
||||||
isOffRefreshRequred |= bus->isOffRefreshRequired();
|
_isOffRefreshRequired |= bus->isOffRefreshRequired();
|
||||||
uint16_t busEnd = bus->getStart() + bus->getLength();
|
uint16_t busEnd = bus->getStart() + bus->getLength();
|
||||||
if (busEnd > _length) _length = busEnd;
|
if (busEnd > _length) _length = busEnd;
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
|
@ -83,7 +83,7 @@ void onAlexaChange(EspalexaDevice* dev)
|
|||||||
seg.setCCT(k, segid);
|
seg.setCCT(k, segid);
|
||||||
if (seg.cct != cctPrev) effectChanged = true; //send UDP
|
if (seg.cct != cctPrev) effectChanged = true; //send UDP
|
||||||
col[0]= 0; col[1]= 0; col[2]= 0; col[3]= 255;
|
col[0]= 0; col[1]= 0; col[2]= 0; col[3]= 255;
|
||||||
} else if (strip.isRgbw) {
|
} else if (strip.hasWhiteChannel()) {
|
||||||
switch (ct) { //these values empirically look good on RGBW
|
switch (ct) { //these values empirically look good on RGBW
|
||||||
case 199: col[0]=255; col[1]=255; col[2]=255; col[3]=255; break;
|
case 199: col[0]=255; col[1]=255; col[2]=255; col[3]=255; break;
|
||||||
case 234: col[0]=127; col[1]=127; col[2]=127; col[3]=255; break;
|
case 234: col[0]=127; col[1]=127; col[2]=127; col[3]=255; break;
|
||||||
|
@ -308,7 +308,7 @@ void handleIO()
|
|||||||
// turn off built-in LED if strip is turned off
|
// turn off built-in LED if strip is turned off
|
||||||
// this will break digital bus so will need to be reinitialised on On
|
// this will break digital bus so will need to be reinitialised on On
|
||||||
PinOwner ledPinOwner = pinManager.getPinOwner(LED_BUILTIN);
|
PinOwner ledPinOwner = pinManager.getPinOwner(LED_BUILTIN);
|
||||||
if (!strip.isOffRefreshRequred && (ledPinOwner == PinOwner::None || ledPinOwner == PinOwner::BusDigital)) {
|
if (!strip.isOffRefreshRequired() && (ledPinOwner == PinOwner::None || ledPinOwner == PinOwner::BusDigital)) {
|
||||||
pinMode(LED_BUILTIN, OUTPUT);
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
digitalWrite(LED_BUILTIN, HIGH);
|
digitalWrite(LED_BUILTIN, HIGH);
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
JsonObject hw = doc[F("hw")];
|
JsonObject hw = doc[F("hw")];
|
||||||
|
|
||||||
// initialize LED pins and lengths prior to other HW (except for ethernet)
|
// initialize LED pins and lengths prior to other HW (except for ethernet)
|
||||||
JsonObject hw_led = hw[F("led")];
|
JsonObject hw_led = hw["led"];
|
||||||
|
|
||||||
CJSON(strip.ablMilliampsMax, hw_led[F("maxpwr")]);
|
CJSON(strip.ablMilliampsMax, hw_led[F("maxpwr")]);
|
||||||
CJSON(strip.milliampsPerLed, hw_led[F("ledma")]);
|
CJSON(strip.milliampsPerLed, hw_led[F("ledma")]);
|
||||||
@ -108,7 +108,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
if (i>4) break;
|
if (i>4) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t length = elm[F("len")] | 1;
|
uint16_t length = elm["len"] | 1;
|
||||||
uint8_t colorOrder = (int)elm[F("order")];
|
uint8_t colorOrder = (int)elm[F("order")];
|
||||||
uint8_t skipFirst = elm[F("skip")];
|
uint8_t skipFirst = elm[F("skip")];
|
||||||
uint16_t start = elm["start"] | 0;
|
uint16_t start = elm["start"] | 0;
|
||||||
@ -133,8 +133,8 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
uint8_t s = 0;
|
uint8_t s = 0;
|
||||||
for (JsonObject entry : hw_com) {
|
for (JsonObject entry : hw_com) {
|
||||||
if (s > WLED_MAX_COLOR_ORDER_MAPPINGS) break;
|
if (s > WLED_MAX_COLOR_ORDER_MAPPINGS) break;
|
||||||
uint16_t start = entry[F("start")] | 0;
|
uint16_t start = entry["start"] | 0;
|
||||||
uint16_t len = entry[F("len")] | 0;
|
uint16_t len = entry["len"] | 0;
|
||||||
uint8_t colorOrder = (int)entry[F("order")];
|
uint8_t colorOrder = (int)entry[F("order")];
|
||||||
com.add(start, len, colorOrder);
|
com.add(start, len, colorOrder);
|
||||||
s++;
|
s++;
|
||||||
@ -232,29 +232,29 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
if (light_gc_col > 1.5) strip.gammaCorrectCol = true;
|
if (light_gc_col > 1.5) strip.gammaCorrectCol = true;
|
||||||
else if (light_gc_col > 0.5) strip.gammaCorrectCol = false;
|
else if (light_gc_col > 0.5) strip.gammaCorrectCol = false;
|
||||||
|
|
||||||
JsonObject light_tr = light[F("tr")];
|
JsonObject light_tr = light["tr"];
|
||||||
CJSON(fadeTransition, light_tr[F("mode")]);
|
CJSON(fadeTransition, light_tr["mode"]);
|
||||||
int tdd = light_tr["dur"] | -1;
|
int tdd = light_tr["dur"] | -1;
|
||||||
if (tdd >= 0) transitionDelayDefault = tdd * 100;
|
if (tdd >= 0) transitionDelayDefault = tdd * 100;
|
||||||
CJSON(strip.paletteFade, light_tr["pal"]);
|
CJSON(strip.paletteFade, light_tr["pal"]);
|
||||||
|
|
||||||
JsonObject light_nl = light["nl"];
|
JsonObject light_nl = light["nl"];
|
||||||
CJSON(nightlightMode, light_nl[F("mode")]);
|
CJSON(nightlightMode, light_nl["mode"]);
|
||||||
byte prev = nightlightDelayMinsDefault;
|
byte prev = nightlightDelayMinsDefault;
|
||||||
CJSON(nightlightDelayMinsDefault, light_nl[F("dur")]);
|
CJSON(nightlightDelayMinsDefault, light_nl["dur"]);
|
||||||
if (nightlightDelayMinsDefault != prev) nightlightDelayMins = nightlightDelayMinsDefault;
|
if (nightlightDelayMinsDefault != prev) nightlightDelayMins = nightlightDelayMinsDefault;
|
||||||
|
|
||||||
CJSON(nightlightTargetBri, light_nl[F("tbri")]);
|
CJSON(nightlightTargetBri, light_nl[F("tbri")]);
|
||||||
CJSON(macroNl, light_nl["macro"]);
|
CJSON(macroNl, light_nl["macro"]);
|
||||||
|
|
||||||
JsonObject def = doc[F("def")];
|
JsonObject def = doc["def"];
|
||||||
CJSON(bootPreset, def["ps"]);
|
CJSON(bootPreset, def["ps"]);
|
||||||
CJSON(turnOnAtBoot, def["on"]); // true
|
CJSON(turnOnAtBoot, def["on"]); // true
|
||||||
CJSON(briS, def["bri"]); // 128
|
CJSON(briS, def["bri"]); // 128
|
||||||
|
|
||||||
JsonObject interfaces = doc["if"];
|
JsonObject interfaces = doc["if"];
|
||||||
|
|
||||||
JsonObject if_sync = interfaces[F("sync")];
|
JsonObject if_sync = interfaces["sync"];
|
||||||
CJSON(udpPort, if_sync[F("port0")]); // 21324
|
CJSON(udpPort, if_sync[F("port0")]); // 21324
|
||||||
CJSON(udpPort2, if_sync[F("port1")]); // 65506
|
CJSON(udpPort2, if_sync[F("port1")]); // 65506
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
CJSON(e131Universe, if_live_dmx[F("uni")]);
|
CJSON(e131Universe, if_live_dmx[F("uni")]);
|
||||||
CJSON(e131SkipOutOfSequence, if_live_dmx[F("seqskip")]);
|
CJSON(e131SkipOutOfSequence, if_live_dmx[F("seqskip")]);
|
||||||
CJSON(DMXAddress, if_live_dmx[F("addr")]);
|
CJSON(DMXAddress, if_live_dmx[F("addr")]);
|
||||||
CJSON(DMXMode, if_live_dmx[F("mode")]);
|
CJSON(DMXMode, if_live_dmx["mode"]);
|
||||||
|
|
||||||
tdd = if_live[F("timeout")] | -1;
|
tdd = if_live[F("timeout")] | -1;
|
||||||
if (tdd >= 0) realtimeTimeoutMs = tdd * 100;
|
if (tdd >= 0) realtimeTimeoutMs = tdd * 100;
|
||||||
@ -577,7 +577,7 @@ void serializeConfig() {
|
|||||||
if (!bus || bus->getLength()==0) break;
|
if (!bus || bus->getLength()==0) break;
|
||||||
JsonObject ins = hw_led_ins.createNestedObject();
|
JsonObject ins = hw_led_ins.createNestedObject();
|
||||||
ins["start"] = bus->getStart();
|
ins["start"] = bus->getStart();
|
||||||
ins[F("len")] = bus->getLength();
|
ins["len"] = bus->getLength();
|
||||||
JsonArray ins_pin = ins.createNestedArray("pin");
|
JsonArray ins_pin = ins.createNestedArray("pin");
|
||||||
uint8_t pins[5];
|
uint8_t pins[5];
|
||||||
uint8_t nPins = bus->getPins(pins);
|
uint8_t nPins = bus->getPins(pins);
|
||||||
@ -587,7 +587,7 @@ void serializeConfig() {
|
|||||||
ins[F("skip")] = bus->skippedLeds();
|
ins[F("skip")] = bus->skippedLeds();
|
||||||
ins["type"] = bus->getType() & 0x7F;
|
ins["type"] = bus->getType() & 0x7F;
|
||||||
ins["ref"] = bus->isOffRefreshRequired();
|
ins["ref"] = bus->isOffRefreshRequired();
|
||||||
ins[F("rgbw")] = bus->isRgbw();
|
//ins[F("rgbw")] = bus->isRgbw();
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonArray hw_com = hw.createNestedArray(F("com"));
|
JsonArray hw_com = hw.createNestedArray(F("com"));
|
||||||
@ -597,8 +597,8 @@ void serializeConfig() {
|
|||||||
if (!entry) break;
|
if (!entry) break;
|
||||||
|
|
||||||
JsonObject co = hw_com.createNestedObject();
|
JsonObject co = hw_com.createNestedObject();
|
||||||
co[F("start")] = entry->start;
|
co["start"] = entry->start;
|
||||||
co[F("len")] = entry->len;
|
co["len"] = entry->len;
|
||||||
co[F("order")] = entry->colorOrder;
|
co[F("order")] = entry->colorOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -645,12 +645,12 @@ void serializeConfig() {
|
|||||||
light_gc["col"] = (strip.gammaCorrectCol) ? 2.8 : 1.0;
|
light_gc["col"] = (strip.gammaCorrectCol) ? 2.8 : 1.0;
|
||||||
|
|
||||||
JsonObject light_tr = light.createNestedObject("tr");
|
JsonObject light_tr = light.createNestedObject("tr");
|
||||||
light_tr[F("mode")] = fadeTransition;
|
light_tr["mode"] = fadeTransition;
|
||||||
light_tr["dur"] = transitionDelayDefault / 100;
|
light_tr["dur"] = transitionDelayDefault / 100;
|
||||||
light_tr["pal"] = strip.paletteFade;
|
light_tr["pal"] = strip.paletteFade;
|
||||||
|
|
||||||
JsonObject light_nl = light.createNestedObject("nl");
|
JsonObject light_nl = light.createNestedObject("nl");
|
||||||
light_nl[F("mode")] = nightlightMode;
|
light_nl["mode"] = nightlightMode;
|
||||||
light_nl["dur"] = nightlightDelayMinsDefault;
|
light_nl["dur"] = nightlightDelayMinsDefault;
|
||||||
light_nl[F("tbri")] = nightlightTargetBri;
|
light_nl[F("tbri")] = nightlightTargetBri;
|
||||||
light_nl["macro"] = macroNl;
|
light_nl["macro"] = macroNl;
|
||||||
@ -695,7 +695,7 @@ void serializeConfig() {
|
|||||||
if_live_dmx[F("uni")] = e131Universe;
|
if_live_dmx[F("uni")] = e131Universe;
|
||||||
if_live_dmx[F("seqskip")] = e131SkipOutOfSequence;
|
if_live_dmx[F("seqskip")] = e131SkipOutOfSequence;
|
||||||
if_live_dmx[F("addr")] = DMXAddress;
|
if_live_dmx[F("addr")] = DMXAddress;
|
||||||
if_live_dmx[F("mode")] = DMXMode;
|
if_live_dmx["mode"] = DMXMode;
|
||||||
|
|
||||||
if_live[F("timeout")] = realtimeTimeoutMs / 100;
|
if_live[F("timeout")] = realtimeTimeoutMs / 100;
|
||||||
if_live[F("maxbri")] = arlsForceMaxBri;
|
if_live[F("maxbri")] = arlsForceMaxBri;
|
||||||
|
@ -365,20 +365,20 @@ void decodeIR40(uint32_t code)
|
|||||||
case IR40_MAGENTA : colorFromUint24(COLOR_MAGENTA); break;
|
case IR40_MAGENTA : colorFromUint24(COLOR_MAGENTA); break;
|
||||||
case IR40_PINK : colorFromUint24(COLOR_PINK); break;
|
case IR40_PINK : colorFromUint24(COLOR_PINK); break;
|
||||||
case IR40_WARMWHITE2 : {
|
case IR40_WARMWHITE2 : {
|
||||||
if (strip.isRgbw) { colorFromUint32(COLOR2_WARMWHITE2); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_WARMWHITE2); effectCurrent = 0; }
|
||||||
else colorFromUint24(COLOR_WARMWHITE2); } break;
|
else colorFromUint24(COLOR_WARMWHITE2); } break;
|
||||||
case IR40_WARMWHITE : {
|
case IR40_WARMWHITE : {
|
||||||
if (strip.isRgbw) { colorFromUint32(COLOR2_WARMWHITE); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_WARMWHITE); effectCurrent = 0; }
|
||||||
else colorFromUint24(COLOR_WARMWHITE); } break;
|
else colorFromUint24(COLOR_WARMWHITE); } break;
|
||||||
case IR40_WHITE : {
|
case IR40_WHITE : {
|
||||||
if (strip.isRgbw) { colorFromUint32(COLOR2_NEUTRALWHITE); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_NEUTRALWHITE); effectCurrent = 0; }
|
||||||
else colorFromUint24(COLOR_NEUTRALWHITE); } break;
|
else colorFromUint24(COLOR_NEUTRALWHITE); } break;
|
||||||
case IR40_COLDWHITE : {
|
case IR40_COLDWHITE : {
|
||||||
if (strip.isRgbw) { colorFromUint32(COLOR2_COLDWHITE); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_COLDWHITE); effectCurrent = 0; }
|
||||||
else colorFromUint24(COLOR_COLDWHITE); } break;
|
else colorFromUint24(COLOR_COLDWHITE); } break;
|
||||||
case IR40_COLDWHITE2 : {
|
case IR40_COLDWHITE2 : {
|
||||||
if (strip.isRgbw) { colorFromUint32(COLOR2_COLDWHITE2); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_COLDWHITE2); effectCurrent = 0; }
|
||||||
else colorFromUint24(COLOR_COLDWHITE2); } break;
|
else colorFromUint24(COLOR_COLDWHITE2); } break;
|
||||||
case IR40_WPLUS : relativeChangeWhite(10); break;
|
case IR40_WPLUS : relativeChangeWhite(10); break;
|
||||||
case IR40_WMINUS : relativeChangeWhite(-10, 5); break;
|
case IR40_WMINUS : relativeChangeWhite(-10, 5); break;
|
||||||
case IR40_WOFF : whiteLast = col[3]; col[3] = 0; break;
|
case IR40_WOFF : whiteLast = col[3]; col[3] = 0; break;
|
||||||
@ -422,22 +422,22 @@ void decodeIR44(uint32_t code)
|
|||||||
case IR44_MAGENTA : colorFromUint24(COLOR_MAGENTA); break;
|
case IR44_MAGENTA : colorFromUint24(COLOR_MAGENTA); break;
|
||||||
case IR44_PINK : colorFromUint24(COLOR_PINK); break;
|
case IR44_PINK : colorFromUint24(COLOR_PINK); break;
|
||||||
case IR44_WHITE : {
|
case IR44_WHITE : {
|
||||||
if (strip.isRgbw) {
|
if (strip.hasWhiteChannel()) {
|
||||||
if (col[3] > 0) col[3] = 0;
|
if (col[3] > 0) col[3] = 0;
|
||||||
else { colorFromUint32(COLOR2_NEUTRALWHITE); effectCurrent = 0; }
|
else { colorFromUint32(COLOR2_NEUTRALWHITE); effectCurrent = 0; }
|
||||||
} else colorFromUint24(COLOR_NEUTRALWHITE); } break;
|
} else colorFromUint24(COLOR_NEUTRALWHITE); } break;
|
||||||
case IR44_WARMWHITE2 : {
|
case IR44_WARMWHITE2 : {
|
||||||
if (strip.isRgbw) { colorFromUint32(COLOR2_WARMWHITE2); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_WARMWHITE2); effectCurrent = 0; }
|
||||||
else colorFromUint24(COLOR_WARMWHITE2); } break;
|
else colorFromUint24(COLOR_WARMWHITE2); } break;
|
||||||
case IR44_WARMWHITE : {
|
case IR44_WARMWHITE : {
|
||||||
if (strip.isRgbw) { colorFromUint32(COLOR2_WARMWHITE); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_WARMWHITE); effectCurrent = 0; }
|
||||||
else colorFromUint24(COLOR_WARMWHITE); } break;
|
else colorFromUint24(COLOR_WARMWHITE); } break;
|
||||||
case IR44_COLDWHITE : {
|
case IR44_COLDWHITE : {
|
||||||
if (strip.isRgbw) { colorFromUint32(COLOR2_COLDWHITE); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_COLDWHITE); effectCurrent = 0; }
|
||||||
else colorFromUint24(COLOR_COLDWHITE); } break;
|
else colorFromUint24(COLOR_COLDWHITE); } break;
|
||||||
case IR44_COLDWHITE2 : {
|
case IR44_COLDWHITE2 : {
|
||||||
if (strip.isRgbw) { colorFromUint32(COLOR2_COLDWHITE2); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_COLDWHITE2); effectCurrent = 0; }
|
||||||
else colorFromUint24(COLOR_COLDWHITE2); } break;
|
else colorFromUint24(COLOR_COLDWHITE2); } break;
|
||||||
case IR44_REDPLUS : relativeChange(&effectCurrent, 1, 0, MODE_COUNT); break;
|
case IR44_REDPLUS : relativeChange(&effectCurrent, 1, 0, MODE_COUNT); break;
|
||||||
case IR44_REDMINUS : relativeChange(&effectCurrent, -1, 0); break;
|
case IR44_REDMINUS : relativeChange(&effectCurrent, -1, 0); break;
|
||||||
case IR44_GREENPLUS : relativeChange(&effectPalette, 1, 0, strip.getPaletteCount() -1); break;
|
case IR44_GREENPLUS : relativeChange(&effectPalette, 1, 0, strip.getPaletteCount() -1); break;
|
||||||
|
@ -18,7 +18,7 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
|
|||||||
uint16_t start = elem["start"] | seg.start;
|
uint16_t start = elem["start"] | seg.start;
|
||||||
int stop = elem["stop"] | -1;
|
int stop = elem["stop"] | -1;
|
||||||
if (stop < 0) {
|
if (stop < 0) {
|
||||||
uint16_t len = elem[F("len")];
|
uint16_t len = elem["len"];
|
||||||
stop = (len > 0) ? start + len : seg.stop;
|
stop = (len > 0) ? start + len : seg.stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,8 +269,8 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
|||||||
|
|
||||||
JsonObject nl = root["nl"];
|
JsonObject nl = root["nl"];
|
||||||
nightlightActive = nl["on"] | nightlightActive;
|
nightlightActive = nl["on"] | nightlightActive;
|
||||||
nightlightDelayMins = nl[F("dur")] | nightlightDelayMins;
|
nightlightDelayMins = nl["dur"] | nightlightDelayMins;
|
||||||
nightlightMode = nl[F("mode")] | nightlightMode;
|
nightlightMode = nl["mode"] | nightlightMode;
|
||||||
nightlightTargetBri = nl[F("tbri")] | nightlightTargetBri;
|
nightlightTargetBri = nl[F("tbri")] | nightlightTargetBri;
|
||||||
|
|
||||||
JsonObject udpn = root["udpn"];
|
JsonObject udpn = root["udpn"];
|
||||||
@ -392,7 +392,7 @@ void serializeSegment(JsonObject& root, WS2812FX::Segment& seg, byte id, bool fo
|
|||||||
root["start"] = seg.start;
|
root["start"] = seg.start;
|
||||||
root["stop"] = seg.stop;
|
root["stop"] = seg.stop;
|
||||||
}
|
}
|
||||||
if (!forPreset) root[F("len")] = seg.stop - seg.start;
|
if (!forPreset) root["len"] = seg.stop - seg.start;
|
||||||
root["grp"] = seg.grouping;
|
root["grp"] = seg.grouping;
|
||||||
root[F("spc")] = seg.spacing;
|
root[F("spc")] = seg.spacing;
|
||||||
root[F("of")] = seg.offset;
|
root[F("of")] = seg.offset;
|
||||||
@ -407,7 +407,7 @@ void serializeSegment(JsonObject& root, WS2812FX::Segment& seg, byte id, bool fo
|
|||||||
// to conserve RAM we will serialize the col array manually
|
// to conserve RAM we will serialize the col array manually
|
||||||
// this will reduce RAM footprint from ~300 bytes to 84 bytes per segment
|
// this will reduce RAM footprint from ~300 bytes to 84 bytes per segment
|
||||||
char colstr[70]; colstr[0] = '['; colstr[1] = '\0'; //max len 68 (5 chan, all 255)
|
char colstr[70]; colstr[0] = '['; colstr[1] = '\0'; //max len 68 (5 chan, all 255)
|
||||||
const char *format = strip.isRgbw ? PSTR("[%u,%u,%u,%u]") : PSTR("[%u,%u,%u]");
|
const char *format = strip.hasWhiteChannel() ? PSTR("[%u,%u,%u,%u]") : PSTR("[%u,%u,%u]");
|
||||||
for (uint8_t i = 0; i < 3; i++)
|
for (uint8_t i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
byte segcol[4]; byte* c = segcol;
|
byte segcol[4]; byte* c = segcol;
|
||||||
@ -455,8 +455,8 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
|
|||||||
|
|
||||||
JsonObject nl = root.createNestedObject("nl");
|
JsonObject nl = root.createNestedObject("nl");
|
||||||
nl["on"] = nightlightActive;
|
nl["on"] = nightlightActive;
|
||||||
nl[F("dur")] = nightlightDelayMins;
|
nl["dur"] = nightlightDelayMins;
|
||||||
nl[F("mode")] = nightlightMode;
|
nl["mode"] = nightlightMode;
|
||||||
nl[F("tbri")] = nightlightTargetBri;
|
nl[F("tbri")] = nightlightTargetBri;
|
||||||
if (nightlightActive) {
|
if (nightlightActive) {
|
||||||
nl[F("rem")] = (nightlightDelayMs - (millis() - nightlightStartTime)) / 1000; // seconds remaining
|
nl[F("rem")] = (nightlightDelayMs - (millis() - nightlightStartTime)) / 1000; // seconds remaining
|
||||||
@ -496,14 +496,14 @@ void serializeInfo(JsonObject root)
|
|||||||
|
|
||||||
JsonObject leds = root.createNestedObject("leds");
|
JsonObject leds = root.createNestedObject("leds");
|
||||||
leds[F("count")] = strip.getLengthTotal();
|
leds[F("count")] = strip.getLengthTotal();
|
||||||
leds[F("rgbw")] = strip.isRgbw;
|
leds[F("rgbw")] = strip.hasWhiteChannel();
|
||||||
leds[F("wv")] = false;
|
leds[F("wv")] = false;
|
||||||
|
|
||||||
leds["cct"] = correctWB || strip.hasCCTBus();
|
leds["cct"] = correctWB || strip.hasCCTBus();
|
||||||
switch (Bus::getAutoWhiteMode()) {
|
switch (Bus::getAutoWhiteMode()) {
|
||||||
case RGBW_MODE_MANUAL_ONLY:
|
case RGBW_MODE_MANUAL_ONLY:
|
||||||
case RGBW_MODE_DUAL:
|
case RGBW_MODE_DUAL:
|
||||||
if (strip.isRgbw) leds[F("wv")] = true;
|
if (strip.hasWhiteChannel()) leds[F("wv")] = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ void WLED::loop()
|
|||||||
#ifdef WLED_DEBUG
|
#ifdef WLED_DEBUG
|
||||||
unsigned long stripMillis = millis();
|
unsigned long stripMillis = millis();
|
||||||
#endif
|
#endif
|
||||||
if (!offMode || strip.isOffRefreshRequred)
|
if (!offMode || strip.isOffRefreshRequired())
|
||||||
strip.service();
|
strip.service();
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
else if (!noWifiSleep)
|
else if (!noWifiSleep)
|
||||||
|
@ -410,7 +410,7 @@ void deEEP() {
|
|||||||
|
|
||||||
JsonArray colarr = segObj.createNestedArray("col");
|
JsonArray colarr = segObj.createNestedArray("col");
|
||||||
|
|
||||||
byte numChannels = (strip.isRgbw)? 4:3;
|
byte numChannels = (strip.hasWhiteChannel())? 4:3;
|
||||||
|
|
||||||
for (uint8_t k = 0; k < 3; k++) //k=0 primary (i+2) k=1 secondary (i+6) k=2 tertiary color (i+12)
|
for (uint8_t k = 0; k < 3; k++) //k=0 primary (i+2) k=1 secondary (i+6) k=2 tertiary color (i+12)
|
||||||
{
|
{
|
||||||
|
@ -138,7 +138,7 @@ bool sendLiveLedsWs(uint32_t wsClient)
|
|||||||
if (!wsc || wsc->queueLength() > 0) return false; //only send if queue free
|
if (!wsc || wsc->queueLength() > 0) return false; //only send if queue free
|
||||||
|
|
||||||
uint16_t used = strip.getLengthTotal();
|
uint16_t used = strip.getLengthTotal();
|
||||||
uint16_t n = ((used-1)/MAX_LIVE_LEDS_WS) +1; //only serve every n'th LED if count over MAX_LIVE_LEDS_WS
|
uint16_t n = ((used -1)/MAX_LIVE_LEDS_WS) +1; //only serve every n'th LED if count over MAX_LIVE_LEDS_WS
|
||||||
AsyncWebSocketMessageBuffer * wsBuf = ws.makeBuffer(2 + (used*3)/n);
|
AsyncWebSocketMessageBuffer * wsBuf = ws.makeBuffer(2 + (used*3)/n);
|
||||||
if (!wsBuf) return false; //out of memory
|
if (!wsBuf) return false; //out of memory
|
||||||
uint8_t* buffer = wsBuf->get();
|
uint8_t* buffer = wsBuf->get();
|
||||||
|
@ -49,7 +49,7 @@ void XML_response(AsyncWebServerRequest *request, char* dest)
|
|||||||
oappend(SET_F("</ix><fp>"));
|
oappend(SET_F("</ix><fp>"));
|
||||||
oappendi(effectPalette);
|
oappendi(effectPalette);
|
||||||
oappend(SET_F("</fp><wv>"));
|
oappend(SET_F("</fp><wv>"));
|
||||||
if (strip.isRgbw) {
|
if (strip.hasWhiteChannel()) {
|
||||||
oappendi(col[3]);
|
oappendi(col[3]);
|
||||||
} else {
|
} else {
|
||||||
oappend("-1");
|
oappend("-1");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user