From e701b5b5ebddb62e565b74ea2c45da7bc8ef8cc2 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 4 Aug 2024 14:02:05 -0400 Subject: [PATCH] util: Print locking module when JSON lock fails For debugging, also log who was trying to lock when it was contended. --- wled00/util.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wled00/util.cpp b/wled00/util.cpp index d2302a085..5d4428be4 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -231,7 +231,9 @@ bool requestJSONBufferLock(uint8_t module) #endif // If the lock is still held - by us, or by another task if (jsonBufferLock) { - DEBUG_PRINT(F("ERROR: Locking JSON buffer failed! (still locked by ")); + DEBUG_PRINT(F("ERROR: Locking JSON buffer (")); + DEBUG_PRINT(module); + DEBUG_PRINT(F(") failed! (still locked by ")); DEBUG_PRINT(jsonBufferLock); DEBUG_PRINTLN(")"); #ifdef ARDUINO_ARCH_ESP32