You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wled00/fcn_declare.h
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -505,8 +505,14 @@ extern "C" {
505
505
voidp_free(void *ptr);
506
506
}
507
507
#ifndef ESP8266
508
-
inlinesize_tgetFreeHeapSize() { returnheap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); } // returns free heap (ESP.getFreeHeap() can include other memory types) // WLEDMM can cause LED glitches
509
-
inlinesize_tgetContiguousFreeHeap() { returnheap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); } // returns largest contiguous free block // WLEDMM may glitch, too
508
+
//inline size_t getFreeHeapSize() { return heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); } // returns free heap (ESP.getFreeHeap() can include other memory types) // WLEDMM can cause LED glitches
509
+
//inline size_t getContiguousFreeHeap() { return heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); } // returns largest contiguous free block // WLEDMM may glitch, too
510
+
511
+
externsize_td_measureFreeHeap(void);
512
+
externsize_td_measureContiguousFreeHeap(void);
513
+
inlinesize_tgetFreeHeapSize() { returnd_measureFreeHeap();} // total free heap - with flicker protection
514
+
inlinesize_tgetContiguousFreeHeap() { returnd_measureContiguousFreeHeap();} // largest free block - with flicker protection
// reconnect WiFi to clear stale allocations if heap gets too low
1351
-
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
uint32_t heap = ESP.getFreeHeap(); // WLEDMM works better on -S2
1350
+
if ((now - heapTime > 5000) && !strip.isUpdating()) { // WLEDMM: updated with better logic for small heap available by block, not total. // WLEDMM trying to use a moment when the strip is idle
1351
+
#ifdef WLEDMM_FILEWAIT // only when we don't use the RMTHI driver
1352
+
// calling getContiguousFreeHeap() during led update causes glitches on C3
1353
+
// this can (probably) be removed once RMT driver for C3 is fixed
1354
+
unsigned t0 = millis();
1355
+
while (strip.isUpdating() && (millis() - t0 < 15)) delay(1); // be nice, but not too nice. Waits up to 15ms
0 commit comments