Skip to content

Commit 5f55f91

Browse files
committed
debug message cleanup
changed some non-critical USER_PRINT debug messages into DEBUG_PRINT
1 parent 423d372 commit 5f55f91

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

wled00/cfg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
2121
//WLEDMM add USER_PRINT
2222
// String temp;
2323
// serializeJson(doc, temp);
24-
USER_PRINTF("deserializeConfig\n");
24+
DEBUG_PRINTF("deserializeConfig\n");
2525

2626
bool needsSave = false;
2727
//int rev_major = doc["rev"][0]; // 1
@@ -1065,7 +1065,7 @@ void serializeConfig() {
10651065
usermods.addToConfig(usermods_settings);
10661066

10671067
//WLEDMM add USER_PRINT
1068-
USER_PRINTF("serializeConfig\n");
1068+
DEBUG_PRINTF("serializeConfig\n");
10691069

10701070
File f = WLED_FS.open("/cfg.json", "w");
10711071
if (f) serializeJson(doc, f);

wled00/json.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ bool deserializeSegment(JsonObject elem, byte it, byte presetId)
5353
{
5454
const bool iAmGroot = !inDeepCall; // WLEDMM will only be true if this is the toplevel of the recursion.
5555
//WLEDMM add USER_PRINT
56+
#ifdef WLED_DEBUG
5657
if (elem.size()!=1 || elem["stop"] != 0) { // not for {"stop":0}
5758
String temp;
5859
serializeJson(elem, temp);
5960
USER_PRINTF("deserializeSegment %s\n", temp.c_str());
6061
}
62+
#endif
6163

6264
byte id = elem["id"] | it;
6365
if (id >= strip.getMaxSegments()) return false;
@@ -374,9 +376,11 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
374376
{
375377
const bool iAmGroot = !inDeepCall; // WLEDMM will only be true if this is the toplevel of the recursion.
376378
//WLEDMM add USER_PRINT
379+
#ifdef WLED_DEBUG
377380
String temp;
378381
serializeJson(root, temp);
379382
USER_PRINTF("deserializeState %s\n", temp.c_str());
383+
#endif
380384

381385
bool stateResponse = root[F("v")] | false;
382386

wled00/wled.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ void WLED::setup()
436436
USER_FLUSH(); delay(100);
437437
USER_PRINTLN();
438438
USER_PRINT(F("---WLED "));
439+
#ifdef WLEDMM_FASTPATH
440+
USER_PRINT("=FASTPATH= ");
441+
#endif
439442
USER_PRINT(versionString);
440443
USER_PRINT(" ");
441444
USER_PRINT(VERSION);

wled00/ws.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static volatile unsigned long wsLastLiveTime = 0; // WLEDMM
1010
//uint8_t* wsFrameBuffer = nullptr;
1111

1212
#if !defined(ARDUINO_ARCH_ESP32) || defined(WLEDMM_FASTPATH) // WLEDMM
13-
#define WS_LIVE_INTERVAL 160
13+
#define WS_LIVE_INTERVAL 120
1414
#else
1515
#define WS_LIVE_INTERVAL 80
1616
#endif
@@ -19,14 +19,14 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp
1919
{
2020
if(type == WS_EVT_CONNECT){
2121
//client connected
22-
USER_PRINTLN(F("WS client connected."));
22+
DEBUG_PRINTLN(F("WS client connected."));
2323
sendDataWs(client);
2424
} else if(type == WS_EVT_DISCONNECT){
2525
//client disconnected
2626
if (client->id() == wsLiveClientId) wsLiveClientId = 0;
27-
USER_PRINTLN(F("WS client disconnected."));
27+
DEBUG_PRINTLN(F("WS client disconnected."));
2828
} else if(type == WS_EVT_DATA){
29-
USER_PRINTLN(F("WS event data."));
29+
DEBUG_PRINTLN(F("WS event data."));
3030
// data packet
3131
AwsFrameInfo * info = (AwsFrameInfo*)arg;
3232
if(info->final && info->index == 0 && info->len == len){
@@ -91,7 +91,7 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp
9191
}
9292
} else if(type == WS_EVT_ERROR){
9393
//error was received from the other end
94-
DEBUG_PRINTLN(F("WS error."));
94+
USER_PRINTLN(F("WS error."));
9595

9696
} else if(type == WS_EVT_PONG){
9797
//pong message was received (in response to a ping request maybe)
@@ -102,7 +102,7 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp
102102

103103
void sendDataWs(AsyncWebSocketClient * client)
104104
{
105-
USER_PRINTF("sendDataWs\n");
105+
DEBUG_PRINTF("sendDataWs\n");
106106
if (!ws.count()) return;
107107
AsyncWebSocketMessageBuffer * buffer;
108108

@@ -147,7 +147,7 @@ void sendDataWs(AsyncWebSocketClient * client)
147147
#endif
148148
if (!buffer || heap1-heap2<len) {
149149
releaseJSONBufferLock();
150-
DEBUG_PRINTLN(F("WS buffer allocation failed."));
150+
USER_PRINTLN(F("WS buffer allocation failed."));
151151
ws.closeAll(1013); //code 1013 = temporary overload, try again later
152152
ws.cleanupClients(0); //disconnect all clients to release memory
153153
ws._cleanBuffers();
@@ -212,7 +212,7 @@ static bool sendLiveLedsWs(uint32_t wsClient) // WLEDMM added "static"
212212
if (wsBuf == nullptr) { // 8266 does not support exceptions
213213
#endif
214214
wsBuf = nullptr;
215-
DEBUG_PRINTLN(F("WS buffer allocation failed."));
215+
USER_PRINTLN(F("WS buffer allocation failed."));
216216
//ws.closeAll(1013); //code 1013 = temporary overload, try again later
217217
//ws.cleanupClients(0); //disconnect all clients to release memory
218218
ws._cleanBuffers();

0 commit comments

Comments
 (0)