Use DEBUG_PRINTF_P for jsonBufferLock

Tiny code space usage reduction.
This commit is contained in:
Will Miles 2024-08-04 15:08:46 -04:00
parent e701b5b5eb
commit 113dbbdf94

View File

@ -231,11 +231,7 @@ bool requestJSONBufferLock(uint8_t module)
#endif #endif
// If the lock is still held - by us, or by another task // If the lock is still held - by us, or by another task
if (jsonBufferLock) { if (jsonBufferLock) {
DEBUG_PRINT(F("ERROR: Locking JSON buffer (")); DEBUG_PRINTF_P(PSTR("ERROR: Locking JSON buffer (%d) failed! (still locked by %d)\n"), module, jsonBufferLock);
DEBUG_PRINT(module);
DEBUG_PRINT(F(") failed! (still locked by "));
DEBUG_PRINT(jsonBufferLock);
DEBUG_PRINTLN(")");
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
xSemaphoreGiveRecursive(jsonBufferLockMutex); xSemaphoreGiveRecursive(jsonBufferLockMutex);
#endif #endif
@ -243,9 +239,7 @@ bool requestJSONBufferLock(uint8_t module)
} }
jsonBufferLock = module ? module : 255; jsonBufferLock = module ? module : 255;
DEBUG_PRINT(F("JSON buffer locked. (")); DEBUG_PRINTF_P(PSTR("JSON buffer locked. (%d)\n"), jsonBufferLock);
DEBUG_PRINT(jsonBufferLock);
DEBUG_PRINTLN(")");
pDoc->clear(); pDoc->clear();
return true; return true;
} }
@ -253,9 +247,7 @@ bool requestJSONBufferLock(uint8_t module)
void releaseJSONBufferLock() void releaseJSONBufferLock()
{ {
DEBUG_PRINT(F("JSON buffer released. (")); DEBUG_PRINTF_P(PSTR("JSON buffer released. (%d)\n"), jsonBufferLock);
DEBUG_PRINT(jsonBufferLock);
DEBUG_PRINTLN(")");
jsonBufferLock = 0; jsonBufferLock = 0;
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
xSemaphoreGiveRecursive(jsonBufferLockMutex); xSemaphoreGiveRecursive(jsonBufferLockMutex);