From f7de7fc4532c58838832b2b46b97447a21a8892e Mon Sep 17 00:00:00 2001 From: George Alexandre Silva Date: Sun, 5 May 2024 19:16:23 -0300 Subject: [PATCH] Free the SDCard heap space --- src/drivers/storage/SDCard.cpp | 6 ++---- src/drivers/storage/SDCard.h | 2 +- src/wManager.cpp | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/drivers/storage/SDCard.cpp b/src/drivers/storage/SDCard.cpp index 1cc773f..a12f5fe 100644 --- a/src/drivers/storage/SDCard.cpp +++ b/src/drivers/storage/SDCard.cpp @@ -176,7 +176,7 @@ bool SDCard::cardAvailable() /// @return true on success bool SDCard::initSDcard() { - if (!cardAvailable()) + if (!cardAvailable()) { Serial.println("SDCard: init SD card interface."); #if defined (BUILD_SDMMC_4) @@ -204,7 +204,6 @@ bool SDCard::initSDcard() } #else - SDCard::SDCard(int ID) {} SDCard::~SDCard() {} void SDCard::SD2nvMemory(nvMemory* nvMem, TSettings* Settings) {}; @@ -212,6 +211,5 @@ bool SDCard::loadConfigFile(TSettings* Settings) { return false; } bool SDCard::initSDcard() { return false; } bool SDCard::cardAvailable() { return false; } bool SDCard::cardBusy() { return false; } -void SDCard::terminate() {}; - +void SDCard::terminate() {} #endif //BUILD_SDMMC diff --git a/src/drivers/storage/SDCard.h b/src/drivers/storage/SDCard.h index 65b5b50..4b0b6f6 100644 --- a/src/drivers/storage/SDCard.h +++ b/src/drivers/storage/SDCard.h @@ -55,7 +55,7 @@ public: bool loadConfigFile(TSettings* Settings); bool cardAvailable(); bool cardBusy(); - void terminate(); + void terminate(); private: bool initSDcard(); bool cardInitialized_; diff --git a/src/wManager.cpp b/src/wManager.cpp index 3ff86f0..9ac3cac 100644 --- a/src/wManager.cpp +++ b/src/wManager.cpp @@ -109,7 +109,7 @@ void init_WifiManager() } }; - // Free the memory from SDCard class + // Free the memory from SDCard class SDCrd.terminate(); // Reset settings (only for development)