Skip to content

Commit

Permalink
reduce WiFi disconnects
Browse files Browse the repository at this point in the history
HUB75 is very heap-hungry - use a more relaxed metric for triggering "low heap emergency" actions
  • Loading branch information
softhack007 committed Aug 8, 2024
1 parent 90dd048 commit c66a8af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wled00/wled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c66a8af

Please sign in to comment.