debug message cleanup

changed some non-critical USER_PRINT debug messages into DEBUG_PRINT
This commit is contained in:
Frank
2023-07-14 16:17:42 +02:00
parent 423d3720b2
commit 5f55f91ff0
4 changed files with 17 additions and 10 deletions

View File

@@ -21,7 +21,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
//WLEDMM add USER_PRINT //WLEDMM add USER_PRINT
// String temp; // String temp;
// serializeJson(doc, temp); // serializeJson(doc, temp);
USER_PRINTF("deserializeConfig\n"); DEBUG_PRINTF("deserializeConfig\n");
bool needsSave = false; bool needsSave = false;
//int rev_major = doc["rev"][0]; // 1 //int rev_major = doc["rev"][0]; // 1
@@ -1065,7 +1065,7 @@ void serializeConfig() {
usermods.addToConfig(usermods_settings); usermods.addToConfig(usermods_settings);
//WLEDMM add USER_PRINT //WLEDMM add USER_PRINT
USER_PRINTF("serializeConfig\n"); DEBUG_PRINTF("serializeConfig\n");
File f = WLED_FS.open("/cfg.json", "w"); File f = WLED_FS.open("/cfg.json", "w");
if (f) serializeJson(doc, f); if (f) serializeJson(doc, f);

View File

@@ -53,11 +53,13 @@ bool deserializeSegment(JsonObject elem, byte it, byte presetId)
{ {
const bool iAmGroot = !inDeepCall; // WLEDMM will only be true if this is the toplevel of the recursion. const bool iAmGroot = !inDeepCall; // WLEDMM will only be true if this is the toplevel of the recursion.
//WLEDMM add USER_PRINT //WLEDMM add USER_PRINT
#ifdef WLED_DEBUG
if (elem.size()!=1 || elem["stop"] != 0) { // not for {"stop":0} if (elem.size()!=1 || elem["stop"] != 0) { // not for {"stop":0}
String temp; String temp;
serializeJson(elem, temp); serializeJson(elem, temp);
USER_PRINTF("deserializeSegment %s\n", temp.c_str()); USER_PRINTF("deserializeSegment %s\n", temp.c_str());
} }
#endif
byte id = elem["id"] | it; byte id = elem["id"] | it;
if (id >= strip.getMaxSegments()) return false; if (id >= strip.getMaxSegments()) return false;
@@ -374,9 +376,11 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
{ {
const bool iAmGroot = !inDeepCall; // WLEDMM will only be true if this is the toplevel of the recursion. const bool iAmGroot = !inDeepCall; // WLEDMM will only be true if this is the toplevel of the recursion.
//WLEDMM add USER_PRINT //WLEDMM add USER_PRINT
#ifdef WLED_DEBUG
String temp; String temp;
serializeJson(root, temp); serializeJson(root, temp);
USER_PRINTF("deserializeState %s\n", temp.c_str()); USER_PRINTF("deserializeState %s\n", temp.c_str());
#endif
bool stateResponse = root[F("v")] | false; bool stateResponse = root[F("v")] | false;

View File

@@ -436,6 +436,9 @@ void WLED::setup()
USER_FLUSH(); delay(100); USER_FLUSH(); delay(100);
USER_PRINTLN(); USER_PRINTLN();
USER_PRINT(F("---WLED ")); USER_PRINT(F("---WLED "));
#ifdef WLEDMM_FASTPATH
USER_PRINT("=FASTPATH= ");
#endif
USER_PRINT(versionString); USER_PRINT(versionString);
USER_PRINT(" "); USER_PRINT(" ");
USER_PRINT(VERSION); USER_PRINT(VERSION);

View File

@@ -10,7 +10,7 @@ static volatile unsigned long wsLastLiveTime = 0; // WLEDMM
//uint8_t* wsFrameBuffer = nullptr; //uint8_t* wsFrameBuffer = nullptr;
#if !defined(ARDUINO_ARCH_ESP32) || defined(WLEDMM_FASTPATH) // WLEDMM #if !defined(ARDUINO_ARCH_ESP32) || defined(WLEDMM_FASTPATH) // WLEDMM
#define WS_LIVE_INTERVAL 160 #define WS_LIVE_INTERVAL 120
#else #else
#define WS_LIVE_INTERVAL 80 #define WS_LIVE_INTERVAL 80
#endif #endif
@@ -19,14 +19,14 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp
{ {
if(type == WS_EVT_CONNECT){ if(type == WS_EVT_CONNECT){
//client connected //client connected
USER_PRINTLN(F("WS client connected.")); DEBUG_PRINTLN(F("WS client connected."));
sendDataWs(client); sendDataWs(client);
} else if(type == WS_EVT_DISCONNECT){ } else if(type == WS_EVT_DISCONNECT){
//client disconnected //client disconnected
if (client->id() == wsLiveClientId) wsLiveClientId = 0; if (client->id() == wsLiveClientId) wsLiveClientId = 0;
USER_PRINTLN(F("WS client disconnected.")); DEBUG_PRINTLN(F("WS client disconnected."));
} else if(type == WS_EVT_DATA){ } else if(type == WS_EVT_DATA){
USER_PRINTLN(F("WS event data.")); DEBUG_PRINTLN(F("WS event data."));
// data packet // data packet
AwsFrameInfo * info = (AwsFrameInfo*)arg; AwsFrameInfo * info = (AwsFrameInfo*)arg;
if(info->final && info->index == 0 && info->len == len){ if(info->final && info->index == 0 && info->len == len){
@@ -91,7 +91,7 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp
} }
} else if(type == WS_EVT_ERROR){ } else if(type == WS_EVT_ERROR){
//error was received from the other end //error was received from the other end
DEBUG_PRINTLN(F("WS error.")); USER_PRINTLN(F("WS error."));
} else if(type == WS_EVT_PONG){ } else if(type == WS_EVT_PONG){
//pong message was received (in response to a ping request maybe) //pong message was received (in response to a ping request maybe)
@@ -102,7 +102,7 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp
void sendDataWs(AsyncWebSocketClient * client) void sendDataWs(AsyncWebSocketClient * client)
{ {
USER_PRINTF("sendDataWs\n"); DEBUG_PRINTF("sendDataWs\n");
if (!ws.count()) return; if (!ws.count()) return;
AsyncWebSocketMessageBuffer * buffer; AsyncWebSocketMessageBuffer * buffer;
@@ -147,7 +147,7 @@ void sendDataWs(AsyncWebSocketClient * client)
#endif #endif
if (!buffer || heap1-heap2<len) { if (!buffer || heap1-heap2<len) {
releaseJSONBufferLock(); releaseJSONBufferLock();
DEBUG_PRINTLN(F("WS buffer allocation failed.")); USER_PRINTLN(F("WS buffer allocation failed."));
ws.closeAll(1013); //code 1013 = temporary overload, try again later ws.closeAll(1013); //code 1013 = temporary overload, try again later
ws.cleanupClients(0); //disconnect all clients to release memory ws.cleanupClients(0); //disconnect all clients to release memory
ws._cleanBuffers(); ws._cleanBuffers();
@@ -212,7 +212,7 @@ static bool sendLiveLedsWs(uint32_t wsClient) // WLEDMM added "static"
if (wsBuf == nullptr) { // 8266 does not support exceptions if (wsBuf == nullptr) { // 8266 does not support exceptions
#endif #endif
wsBuf = nullptr; wsBuf = nullptr;
DEBUG_PRINTLN(F("WS buffer allocation failed.")); USER_PRINTLN(F("WS buffer allocation failed."));
//ws.closeAll(1013); //code 1013 = temporary overload, try again later //ws.closeAll(1013); //code 1013 = temporary overload, try again later
//ws.cleanupClients(0); //disconnect all clients to release memory //ws.cleanupClients(0); //disconnect all clients to release memory
ws._cleanBuffers(); ws._cleanBuffers();