Use ESP.getFreeHeap() instead of SDK function

Add free mem in config report
This commit is contained in:
luc lebosse 2016-06-16 21:47:48 +02:00
parent d7b1e486e2
commit 22af45d69f
2 changed files with 7 additions and 1 deletions

View File

@ -24,6 +24,9 @@ extern "C" {
#include "user_interface.h"
}
extern String formatBytes(size_t bytes);
//read a string
//a string is multibyte + \0, this is won't work if 1 char is multibyte like chinese char
bool CONFIG::read_string(int pos, char byte_buffer[], int size_max)
@ -423,6 +426,9 @@ void CONFIG::print_config()
Serial.println(F("Error reading E feed rate"));
}
Serial.print(F("Free memory: "));
Serial.println(formatBytes(ESP.getFreeHeap()));
Serial.print(F("Captive portal: "));
#ifdef CAPTIVE_PORTAL_FEATURE
Serial.println(F("Enabled"));

View File

@ -542,7 +542,7 @@ void GetFreeMem(STORESTRINGS_CLASS & KeysList, STORESTRINGS_CLASS & ValuesList)
{
//FreeMem
KeysList.add(FPSTR(KEY_FREE_MEM));
ValuesList.add(intTostr(system_get_free_heap_size()));
ValuesList.add(intTostr(ESP.getFreeHeap()));
//FW Version
KeysList.add(FPSTR(KEY_FW_VER));
ValuesList.add(FPSTR(VALUE_FW_VERSION));