Skip to content

Commit

Permalink
Update WiFiManager.cpp
Browse files Browse the repository at this point in the history
adds more heap debug debug_level DEBUG_MAX to enable
#961 #518
  • Loading branch information
tablatronix committed Nov 13, 2019
1 parent a235588 commit e45bdb1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

This comment has been minimized.

Copy link
@crankyoldgit

crankyoldgit Nov 13, 2019

This line is breaking the build of your WiFiManager dev branch.

See: https://travis-ci.org/tzapu/WiFiManager/builds/611206484#L4049

/usr/local/share/arduino/libraries/WiFiManager/WiFiManager.cpp: In member function 'void WiFiManager::DEBUG_WM(WiFiManager::wm_debuglevel_t, Generic, Genericb)':
/usr/local/share/arduino/libraries/WiFiManager/WiFiManager.cpp:2460:9: error: 'class EspClass' has no member named 'getHeapStats'
     ESP.getHeapStats(&free, &max, &frag);

I noticed it when Travis CI told me recent PR failed for my own project.
https://travis-ci.org/crankyoldgit/IRremoteESP8266/jobs/611283011#L5873

WiFiManager.cpp:2459:9: error: 'class EspClass' has no member named 'getHeapStats'
     ESP.getHeapStats(&free, &max, &frag);
         ^

Ref: crankyoldgit/IRremoteESP8266#993

This comment has been minimized.

Copy link
@tablatronix

tablatronix Nov 13, 2019

Author Collaborator

Thanks, I have to fix for esp32

This comment has been minimized.

Copy link
@crankyoldgit

crankyoldgit Nov 13, 2019

Thanks for your prompt action, and for the fine work that is WiFiManager in general!

This comment has been minimized.

Copy link
@tablatronix

tablatronix Nov 14, 2019

Author Collaborator

for reference fb29462

_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+"] ");
Expand Down

0 comments on commit e45bdb1

Please sign in to comment.