small update for code clarity

wraping esp32SemGive inro #ifdef ESP32 does not change the behavior, but makes the logic easier to understand.
This commit is contained in:
Frank
2025-12-23 00:41:45 +01:00
parent c185f37791
commit d6e2473ea7

View File

@@ -238,7 +238,9 @@ bool requestJSONBufferLock(uint8_t module)
#endif
if (jsonBufferLock || !haveLock) {
#ifdef ARDUINO_ARCH_ESP32
if (haveLock) esp32SemGive(jsonBufferLockMutex); // we got the mutex, but jsonBufferLock says the opposite -> give up
#endif
USER_PRINT(F("ERROR: Locking JSON buffer failed! (still locked by "));
USER_PRINT(jsonBufferLock);
USER_PRINTLN(")");
@@ -263,7 +265,9 @@ void releaseJSONBufferLock()
DEBUG_PRINTLN(")");
fileDoc = nullptr;
jsonBufferLock = 0;
#ifdef ARDUINO_ARCH_ESP32
esp32SemGive(jsonBufferLockMutex); // return the mutex
#endif
}