From 5f55f91ff0ccb8f584b372e23d493716fa159762 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:17:42 +0200 Subject: [PATCH] debug message cleanup changed some non-critical USER_PRINT debug messages into DEBUG_PRINT --- wled00/cfg.cpp | 4 ++-- wled00/json.cpp | 4 ++++ wled00/wled.cpp | 3 +++ wled00/ws.cpp | 16 ++++++++-------- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index b570feec..ce5a8643 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -21,7 +21,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { //WLEDMM add USER_PRINT // String temp; // serializeJson(doc, temp); - USER_PRINTF("deserializeConfig\n"); + DEBUG_PRINTF("deserializeConfig\n"); bool needsSave = false; //int rev_major = doc["rev"][0]; // 1 @@ -1065,7 +1065,7 @@ void serializeConfig() { usermods.addToConfig(usermods_settings); //WLEDMM add USER_PRINT - USER_PRINTF("serializeConfig\n"); + DEBUG_PRINTF("serializeConfig\n"); File f = WLED_FS.open("/cfg.json", "w"); if (f) serializeJson(doc, f); diff --git a/wled00/json.cpp b/wled00/json.cpp index 168c1853..50a7f882 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -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. //WLEDMM add USER_PRINT + #ifdef WLED_DEBUG if (elem.size()!=1 || elem["stop"] != 0) { // not for {"stop":0} String temp; serializeJson(elem, temp); USER_PRINTF("deserializeSegment %s\n", temp.c_str()); } + #endif byte id = elem["id"] | it; 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. //WLEDMM add USER_PRINT + #ifdef WLED_DEBUG String temp; serializeJson(root, temp); USER_PRINTF("deserializeState %s\n", temp.c_str()); + #endif bool stateResponse = root[F("v")] | false; diff --git a/wled00/wled.cpp b/wled00/wled.cpp index ef844fc6..adfa2b82 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -436,6 +436,9 @@ void WLED::setup() USER_FLUSH(); delay(100); USER_PRINTLN(); USER_PRINT(F("---WLED ")); + #ifdef WLEDMM_FASTPATH + USER_PRINT("=FASTPATH= "); + #endif USER_PRINT(versionString); USER_PRINT(" "); USER_PRINT(VERSION); diff --git a/wled00/ws.cpp b/wled00/ws.cpp index 03e8ce59..1a7bcb77 100644 --- a/wled00/ws.cpp +++ b/wled00/ws.cpp @@ -10,7 +10,7 @@ static volatile unsigned long wsLastLiveTime = 0; // WLEDMM //uint8_t* wsFrameBuffer = nullptr; #if !defined(ARDUINO_ARCH_ESP32) || defined(WLEDMM_FASTPATH) // WLEDMM -#define WS_LIVE_INTERVAL 160 +#define WS_LIVE_INTERVAL 120 #else #define WS_LIVE_INTERVAL 80 #endif @@ -19,14 +19,14 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp { if(type == WS_EVT_CONNECT){ //client connected - USER_PRINTLN(F("WS client connected.")); + DEBUG_PRINTLN(F("WS client connected.")); sendDataWs(client); } else if(type == WS_EVT_DISCONNECT){ //client disconnected if (client->id() == wsLiveClientId) wsLiveClientId = 0; - USER_PRINTLN(F("WS client disconnected.")); + DEBUG_PRINTLN(F("WS client disconnected.")); } else if(type == WS_EVT_DATA){ - USER_PRINTLN(F("WS event data.")); + DEBUG_PRINTLN(F("WS event data.")); // data packet AwsFrameInfo * info = (AwsFrameInfo*)arg; 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){ //error was received from the other end - DEBUG_PRINTLN(F("WS error.")); + USER_PRINTLN(F("WS error.")); } else if(type == WS_EVT_PONG){ //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) { - USER_PRINTF("sendDataWs\n"); + DEBUG_PRINTF("sendDataWs\n"); if (!ws.count()) return; AsyncWebSocketMessageBuffer * buffer; @@ -147,7 +147,7 @@ void sendDataWs(AsyncWebSocketClient * client) #endif if (!buffer || heap1-heap2