From e6334d8e3d49468afea94f60521370fa222cd404 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Wed, 7 Jun 2023 12:25:41 +0200 Subject: [PATCH] hide "slow strip" when compiling with HEAP_DEBUG --- wled00/wled.cpp | 2 ++ wled00/wled00.ino | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index ee089439..2294ea7c 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -193,7 +193,9 @@ void WLED::loop() #endif #ifdef WLED_DEBUG stripMillis = millis() - stripMillis; + #ifndef WLED_DEBUG_HEAP // WLEDMM heap debug messages take some time - this warning is popping in too often if (stripMillis > 50) DEBUG_PRINTLN("Slow strip."); + #endif avgStripMillis += stripMillis; if (stripMillis > maxStripMillis) maxStripMillis = stripMillis; #endif diff --git a/wled00/wled00.ino b/wled00/wled00.ino index dd316dae..056d8f28 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -47,7 +47,7 @@ void esp_heap_trace_free_hook(void* ptr) Serial.println("** free: attempt to free nullptr."); } else { size_t blocksize = heap_caps_get_allocated_size(ptr); - if (blocksize > 256000) + if ((blocksize < 1) || (blocksize > 256000)) Serial.println("**** free: bad pointer to " + String(blocksize) + "bytes."); else Serial.println("** free " + String(blocksize) + "bytes.");