Skip to content

Commit 4f96886

Browse files
committed
fix for low heap situations on ESP8266
1 parent 1948293 commit 4f96886

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

wled00/util.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,8 @@ int32_t hw_random(int32_t lowerlimit, int32_t upperlimit) {
647647
#ifdef ESP8266
648648
static void *validateFreeHeap(void *buffer) {
649649
// make sure there is enough free heap left if buffer was allocated in DRAM region, free it if not
650-
if (getContiguousFreeHeap() < MIN_HEAP_SIZE) {
650+
// note: ESP826 needs very little contiguous heap for webserver, checking total free heap works better
651+
if (getFreeHeapSize() < MIN_HEAP_SIZE) {
651652
free(buffer);
652653
return nullptr;
653654
}

0 commit comments

Comments
 (0)