JSON buffer lock error messages

Reduce wait time for lock to 100ms
This commit is contained in:
Blaz Kristan
2024-02-17 11:30:29 +01:00
committed by Frank
parent 22d0675a3b
commit c9611bde73
4 changed files with 22 additions and 9 deletions

View File

@@ -136,7 +136,10 @@ void handleSerial()
} else if (next == '{') { //JSON API
bool verboseResponse = false;
if (!requestJSONBufferLock(16)) return;
if (!requestJSONBufferLock(16)) {
Serial.println(F("{\"error\":3}")); // ERR_NOBUF
return;
}
Serial.setTimeout(100);
DeserializationError error = deserializeJson(doc, Serial);
if (error) {