general cleanup

This commit is contained in:
proddy
2021-02-27 15:23:43 +01:00
parent 555fd94ea7
commit 39b8a2b559
3 changed files with 6 additions and 457 deletions

View File

@@ -97,7 +97,9 @@ void System::restart() {
LOG_INFO(F("Restarting system..."));
Shell::loop_all();
delay(1000); // wait a second
#ifndef EMSESP_STANDALONE
ESP.restart();
#endif
}
// saves all settings
@@ -118,7 +120,9 @@ void System::format(uuid::console::Shell & shell) {
EMSuart::stop();
#ifndef EMSESP_STANDALONE
LITTLEFS.format();
#endif
System::restart();
}
@@ -344,10 +348,12 @@ void System::loop() {
}
void System::show_mem(const char * note) {
#ifndef EMSESP_STANDALONE
static uint32_t old_free_heap = 0;
uint32_t free_heap = ESP.getFreeHeap();
LOG_INFO(F("(%s) Free heap: %lu (~%lu)"), note, free_heap, (uint32_t)Helpers::abs(free_heap - old_free_heap));
old_free_heap = free_heap;
#endif
}
// send periodic MQTT message with system information