From c66a8af85cfa91055be56802d1eed8865683943e Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 8 Aug 2024 17:44:13 +0200 Subject: [PATCH] reduce WiFi disconnects HUB75 is very heap-hungry - use a more relaxed metric for triggering "low heap emergency" actions --- wled00/wled.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 171be5c7bc..dfc7e75cc4 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -1220,7 +1220,7 @@ void WLED::handleConnection() #ifdef ARDUINO_ARCH_ESP32 // reconnect WiFi to clear stale allocations if heap gets too low if ((!strip.isUpdating()) && (now - heapTime > 5000)) { // WLEDMM: updated with better logic for small heap available by block, not total. // WLEDMM trying to use a moment when the strip is idle -#if defined(ARDUINO_ARCH_ESP32S2) +#if defined(ARDUINO_ARCH_ESP32S2) || defined(WLED_ENABLE_HUB75MATRIX) uint32_t heap = ESP.getFreeHeap(); // WLEDMM works better on -S2 #else uint32_t heap = heap_caps_get_largest_free_block(0x1800); // WLEDMM: This is a better metric for free heap.