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