Possible double JSON use bugfix.

This commit is contained in:
Blaž Kristan 2021-12-09 13:01:22 +01:00
parent 712e05479b
commit e489b08bc1
2 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) {
void handlePlaylist() {
static unsigned long presetCycledTime = 0;
if (currentPlaylist < 0 || playlistEntries == nullptr) return;
if (currentPlaylist < 0 || playlistEntries == nullptr || fileDoc != nullptr) return;
if (millis() - presetCycledTime > (100*playlistEntryDur)) {
presetCycledTime = millis();

View File

@ -570,7 +570,7 @@ WLED_GLOBAL uint16_t olen _INIT(0);
WLED_GLOBAL size_t fsBytesUsed _INIT(0);
WLED_GLOBAL size_t fsBytesTotal _INIT(0);
WLED_GLOBAL unsigned long presetsModifiedTime _INIT(0L);
WLED_GLOBAL JsonDocument* fileDoc;
WLED_GLOBAL volatile JsonDocument* fileDoc;
WLED_GLOBAL bool doCloseFile _INIT(false);
// presets