Removed dynamic JSON buffer entirely.

Temporary presets in RAM (ESP32)
Async loading of presets (stability).
Other minor fixes.
Bumped version to 0.13.1-bl6
This commit is contained in:
Blaz Kristan
2022-01-01 12:52:50 +01:00
parent 40323e3afe
commit 8386b9a0b4
25 changed files with 2067 additions and 2115 deletions

View File

@@ -71,12 +71,10 @@ void decBrightness()
// apply preset or fallback to a effect and palette if it doesn't exist
void presetFallback(uint8_t presetID, uint8_t effectID, uint8_t paletteID)
{
byte prevError = errorFlag;
if (!applyPreset(presetID, CALL_MODE_BUTTON_PRESET)) {
effectCurrent = effectID;
effectPalette = paletteID;
errorFlag = prevError; //clear error 12 from non-existent preset
}
applyPreset(presetID, CALL_MODE_BUTTON_PRESET);
//these two will be overwritten if preset exists in handlePresets()
effectCurrent = effectID;
effectPalette = paletteID;
}
/*
@@ -575,11 +573,7 @@ void decodeIRJson(uint32_t code)
JsonObject fdo;
JsonObject jsonCmdObj;
#ifdef WLED_USE_DYNAMIC_JSON
DynamicJsonDocument doc(JSON_BUFFER_SIZE);
#else
if (!requestJSONBufferLock(13)) return;
#endif
sprintf_P(objKey, PSTR("\"0x%lX\":"), (unsigned long)code);
@@ -614,9 +608,9 @@ void decodeIRJson(uint32_t code)
lastValidCode = code;
decBrightness();
} else if (cmdStr.startsWith(F("!presetF"))) { //!presetFallback
uint8_t p1 = fdo["PL"] ? fdo["PL"] : 1;
uint8_t p2 = fdo["FX"] ? fdo["FX"] : random8(MODE_COUNT);
uint8_t p3 = fdo["FP"] ? fdo["FP"] : 0;
uint8_t p1 = fdo["PL"] | 1;
uint8_t p2 = fdo["FX"] | random8(MODE_COUNT);
uint8_t p3 = fdo["FP"] | 0;
presetFallback(p1, p2, p3);
}
} else {