reduce WiFi disconnects

HUB75 is very heap-hungry - use a more relaxed metric for triggering "low heap emergency" actions
This commit is contained in:
Frank
2024-08-08 17:44:13 +02:00
parent 90dd048878
commit c66a8af85c

View File

@@ -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.