From 7593c23105b53a848cabab39fb68e4824d3aaa6f Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 12 Feb 2024 21:51:23 +0100 Subject: [PATCH] minor fixies * setup: print free filesystem space after mount * loop: forgot to actually reset the stale lock * handleConnection: (8266) user messages in case of "heap too low". --- wled00/wled.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index f7b907e1..a5a93430 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -225,6 +225,7 @@ void WLED::loop() } else { if (suspendStripService && (millis() - lastTimeService > 1500)) { // WLEDMM remove stale lock after 1.5 seconds USER_PRINTLN("--> looptask: stale suspendStripService lock removed after 1500 ms."); // should not happen - check for missing "suspendStripService = false" + suspendStripService = false; } } #endif @@ -679,7 +680,8 @@ pinManager.allocateMultiplePins(pins, sizeof(pins)/sizeof(managed_pin_type), Pin #endif updateFSInfo(); - USER_PRINTLN(F("done Mounting FS")); + USER_PRINT(F("done Mounting FS; ")); + USER_PRINT(((fsBytesTotal-fsBytesUsed)/1024)); USER_PRINTLN(F(" kB free.")); // generate module IDs must be done before AP setup escapedMac = WiFi.macAddress(); @@ -1233,11 +1235,13 @@ void WLED::handleConnection() if (now - heapTime > 5000) { uint32_t heap = ESP.getFreeHeap(); if (heap < MIN_HEAP_SIZE && lastHeap < MIN_HEAP_SIZE) { - DEBUG_PRINT(F("Heap too low! ")); - DEBUG_PRINTLN(heap); + USER_PRINT(F("Heap too low! (step 2, force reconnect): ")); + USER_PRINTLN(heap); forceReconnect = true; strip.purgeSegments(true); // remove all but one segments from memory } else if (heap < MIN_HEAP_SIZE) { + USER_PRINT(F("Heap too low! (step 1, purge segments): ")); + USER_PRINTLN(heap); strip.purgeSegments(); } lastHeap = heap;