FPS drop workaround.

This commit is contained in:
Blaž Kristan 2021-03-23 07:05:40 +01:00
parent 7ac5abe7f8
commit f6772eaf59
3 changed files with 8 additions and 4 deletions

View File

@ -121,6 +121,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
// actual finalization is done in WLED::loop() (removing old busses and adding new)
if (busConfigs[s] != nullptr) delete busConfigs[s];
busConfigs[s] = new BusConfig(type, pins, start, length, colorOrder, request->hasArg(cv), skipFirstLed);
doInitBusses = true;
}
ledCount = request->arg(F("LC")).toInt();

View File

@ -218,7 +218,9 @@ void WLED::loop()
handleBlynk();
//LED settings have been saved, re-init busses
if (busConfigs[0] != nullptr) {
//This code block causes severe FPS drop on ESP32 with the original "if (busConfigs[0] != nullptr)" conditional. Investigate!
if (doInitBusses) {
doInitBusses = false;
DEBUG_PRINTLN(F("Re-init busses."));
busses.removeAll();
uint32_t mem = 0;

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2103221
#define VERSION 2103230
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG
@ -173,7 +173,7 @@
#endif
// Global Variable definitions
WLED_GLOBAL char versionString[] _INIT("0.12.0-b1");
WLED_GLOBAL char versionString[] _INIT("0.12.0-b2");
#define WLED_CODENAME "Hikari"
// AP and OTA default passwords (for maximum security change them!)
@ -563,7 +563,8 @@ WLED_GLOBAL bool e131NewData _INIT(false);
// led fx library object
WLED_GLOBAL BusManager busses _INIT(BusManager());
WLED_GLOBAL WS2812FX strip _INIT(WS2812FX());
WLED_GLOBAL BusConfig* busConfigs[WLED_MAX_BUSSES]; //temporary, to remember values from network callback until after
WLED_GLOBAL BusConfig* busConfigs[WLED_MAX_BUSSES]; //temporary, to remember values from network callback until after
WLED_GLOBAL bool doInitBusses _INIT(false);
// Usermod manager
WLED_GLOBAL UsermodManager usermods _INIT(UsermodManager());