mirror of
https://github.com/wled/WLED.git
synced 2025-07-23 18:56:41 +00:00
Reduction of flicering on web access (info)
This commit is contained in:
parent
e0a954caa2
commit
1cb3ab82c2
@ -809,6 +809,11 @@ void WS2812FX::finalizeInit(void)
|
|||||||
seg.resetIfRequired();
|
seg.resetIfRequired();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for the lack of better place enumerate ledmaps here
|
||||||
|
// if we do it in json.cpp (serializeInfo()) we are getting flashes on LEDs
|
||||||
|
// unfortunately this means we do not get updates after uploads
|
||||||
|
enumerateLedmaps();
|
||||||
|
|
||||||
_hasWhiteChannel = _isOffRefreshRequired = 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, ...)
|
||||||
|
@ -327,6 +327,7 @@ uint8_t extractModeSlider(uint8_t mode, uint8_t slider, char *dest, uint8_t maxL
|
|||||||
int16_t extractModeDefaults(uint8_t mode, const char *segVar);
|
int16_t extractModeDefaults(uint8_t mode, const char *segVar);
|
||||||
uint16_t crc16(const unsigned char* data_p, size_t length);
|
uint16_t crc16(const unsigned char* data_p, size_t length);
|
||||||
um_data_t* simulateSound(uint8_t simulationId);
|
um_data_t* simulateSound(uint8_t simulationId);
|
||||||
|
void enumerateLedmaps();
|
||||||
|
|
||||||
#ifdef WLED_ADD_EEPROM_SUPPORT
|
#ifdef WLED_ADD_EEPROM_SUPPORT
|
||||||
//wled_eeprom.cpp
|
//wled_eeprom.cpp
|
||||||
|
@ -654,12 +654,7 @@ void serializeInfo(JsonObject root)
|
|||||||
|
|
||||||
JsonArray ledmaps = root.createNestedArray(F("maps"));
|
JsonArray ledmaps = root.createNestedArray(F("maps"));
|
||||||
for (size_t i=0; i<10; i++) {
|
for (size_t i=0; i<10; i++) {
|
||||||
char fileName[16];
|
if ((ledMaps>>i) & 0x0001) ledmaps.add(i);
|
||||||
strcpy_P(fileName, PSTR("/ledmap"));
|
|
||||||
if (i) sprintf(fileName +7, "%d", i);
|
|
||||||
strcat_P(fileName, PSTR(".json"));
|
|
||||||
bool isFile = WLED_FS.exists(fileName);
|
|
||||||
if (isFile || i==0) ledmaps.add(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonObject wifi_info = root.createNestedObject("wifi");
|
JsonObject wifi_info = root.createNestedObject("wifi");
|
||||||
|
@ -503,3 +503,14 @@ um_data_t* simulateSound(uint8_t simulationId)
|
|||||||
return um_data;
|
return um_data;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void enumerateLedmaps() {
|
||||||
|
ledMaps = 1;
|
||||||
|
for (size_t i=1; i<10; i++) {
|
||||||
|
char fileName[16];
|
||||||
|
sprintf_P(fileName, PSTR("/ledmap%d.json"), i);
|
||||||
|
bool isFile = WLED_FS.exists(fileName);
|
||||||
|
if (isFile) ledMaps |= 1 << i;
|
||||||
|
}
|
||||||
|
}
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 2208061
|
#define VERSION 2208101
|
||||||
|
|
||||||
//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
|
||||||
@ -639,6 +639,7 @@ WLED_GLOBAL WS2812FX strip _INIT(WS2812FX());
|
|||||||
WLED_GLOBAL BusConfig* busConfigs[WLED_MAX_BUSSES] _INIT({nullptr}); //temporary, to remember values from network callback until after
|
WLED_GLOBAL BusConfig* busConfigs[WLED_MAX_BUSSES] _INIT({nullptr}); //temporary, to remember values from network callback until after
|
||||||
WLED_GLOBAL bool doInitBusses _INIT(false);
|
WLED_GLOBAL bool doInitBusses _INIT(false);
|
||||||
WLED_GLOBAL int8_t loadLedmap _INIT(-1);
|
WLED_GLOBAL int8_t loadLedmap _INIT(-1);
|
||||||
|
WLED_GLOBAL uint16_t ledMaps _INIT(0); // bitfield representation of available ledmaps
|
||||||
|
|
||||||
// Usermod manager
|
// Usermod manager
|
||||||
WLED_GLOBAL UsermodManager usermods _INIT(UsermodManager());
|
WLED_GLOBAL UsermodManager usermods _INIT(UsermodManager());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user