Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,9 @@ void WS2812FX::blendSegment(const Segment &topSegment) const {
// workaround for On/Off transition
// (bri != briT) && !bri => from On to Off
// (bri != briT) && bri => from Off to On
if ((briOld == 0 || bri == 0) && ((!clipped && (bri != briT) && !bri) || (clipped && (bri != briT) && bri))) c_a = BLACK;
// note: only blank pixels once the segment transition has actually started; bri changes before
// startTransition() is called (stateUpdated()) and a frame rendered in that window would blank the whole segment
if (topSegment.isInTransition() && (briOld == 0 || bri == 0) && ((!clipped && (bri != briT) && !bri) || (clipped && (bri != briT) && bri))) c_a = BLACK;
}
// map it into frame buffer
x = c; // restore coordiates if we were PUSHing
Expand Down Expand Up @@ -1657,7 +1659,9 @@ void WS2812FX::blendSegment(const Segment &topSegment) const {
// workaround for On/Off transition
// (bri != briT) && !bri => from On to Off
// (bri != briT) && bri => from Off to On
if ((briOld == 0 || bri == 0) && ((!clipped && (bri != briT) && !bri) || (clipped && (bri != briT) && bri))) c_a = BLACK;
// note: only blank pixels once the segment transition has actually started; bri changes before
// startTransition() is called (stateUpdated()) and a frame rendered in that window would blank the whole segment
if (topSegment.isInTransition() && (briOld == 0 || bri == 0) && ((!clipped && (bri != briT) && !bri) || (clipped && (bri != briT) && bri))) c_a = BLACK;
}
// map into frame buffer
i = k; // restore index if we were PUSHing
Expand Down Expand Up @@ -1907,8 +1911,9 @@ void WS2812FX::resetSegments() {
if (isServicing()) return;
_segments.clear(); // destructs all Segment as part of clearing
_segments.emplace_back(0, isMatrix ? Segment::maxWidth : _length, 0, isMatrix ? Segment::maxHeight : 1);
if(_segments.size() == 0) {
_segments.emplace_back(); // if out of heap, create a default segment
if (getActiveSegmentsNum() == 0) {
_segments.clear(); // free failed segment
_segments.emplace_back(); // if out of heap, create a default 30 pixel segment
errorFlag = ERR_NORAM_PX;
}
_segments.shrink_to_fit(); // just in case ...
Expand Down Expand Up @@ -1985,6 +1990,7 @@ void WS2812FX::makeAutoSegments(bool forceReset) {
#endif
}
}
if (getActiveSegmentsNum() == 0) resetSegments(); // fallback if auto segment creation failed
_mainSegment = 0;

fixInvalidSegments();
Expand Down
3 changes: 2 additions & 1 deletion wled00/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ void WiFiEvent(WiFiEvent_t event)
switch (event) {
case ARDUINO_EVENT_WIFI_AP_STADISCONNECTED:
// AP client disconnected
if (--apClients == 0 && isWiFiConfigured()) forceReconnect = true; // no clients reconnect WiFi if awailable
if (apClients > 0) apClients--;
if (apClients == 0 && isWiFiConfigured()) forceReconnect = true; // no clients reconnect WiFi if available
DEBUG_PRINTF_P(PSTR("WiFi-E: AP Client Disconnected (%d) @ %lus.\n"), (int)apClients, millis()/1000);
break;
case ARDUINO_EVENT_WIFI_AP_STACONNECTED:
Expand Down
3 changes: 2 additions & 1 deletion wled00/playlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) {
it++;
}
}
for (int i = it; i < playlistLen; i++) playlistEntries[i].tr = playlistEntries[it -1].tr;
if (it > 0) // should never happen but just in case
for (int i = it; i < playlistLen; i++) playlistEntries[i].tr = playlistEntries[it -1].tr;

int rep = playlistObj[F("repeat")];
bool shuffle = false;
Expand Down
2 changes: 1 addition & 1 deletion wled00/set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
apBehavior = request->arg(F("AB")).toInt();
char oldSSID[33]; strcpy(oldSSID, apSSID);
strlcpy(apSSID, request->arg(F("AS")).c_str(), 33);
if (!strcmp(oldSSID, apSSID) && apActive) forceReconnect = true;
if ((strcmp(oldSSID, apSSID) != 0) && apActive) forceReconnect = true; // AP SSID changed
apHide = request->hasArg(F("AH"));
int passlen = request->arg(F("AP")).length();
if (passlen == 0 || (passlen > 7 && !isAsterisksOnly(request->arg(F("AP")).c_str(), 65))) {
Expand Down
Loading