From e45bdb1831c76da095ec7e5bc232879506c105c7 Mon Sep 17 00:00:00 2001 From: tablatronix Date: Tue, 12 Nov 2019 22:54:45 -0600 Subject: [PATCH] Update WiFiManager.cpp adds more heap debug debug_level DEBUG_MAX to enable #961 #518 --- WiFiManager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index a959836..f3bcf12 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -2453,8 +2453,15 @@ void WiFiManager::DEBUG_WM(wm_debuglevel_t level,Generic text,Genericb textb) { if(!_debug || _debugLevel < level) return; if(_debugLevel >= DEBUG_MAX){ - _debugPort.print("MEM: "); - _debugPort.println((String)ESP.getFreeHeap()); + _debugPort.println("MEM: "); + uint32_t free; + uint16_t max; + uint8_t frag; + ESP.getHeapStats(&free, &max, &frag); + _debugPort.printf("[MEM] free: %5d | max: %5d | frag: %3d%% \n", free, max, frag); + // _debugPort.print((String)ESP.getFreeHeap()); + // _debugPort.print((String)ESP.getMaxFreeBlockSize()); + // _debugPort.print((String)ESP.getHeapFragmentation()); } _debugPort.print("*WM: "); if(_debugLevel == DEBUG_DEV) _debugPort.print("["+(String)level+"] ");