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
parent 95e2e574b8
commit 5761dce957
5 changed files with 25 additions and 9 deletions

View File

@@ -113,7 +113,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(*pDoc, Serial);
if (error) {