Free SDCard heap space
This commit is contained in:
parent
6a936da474
commit
8d3349d080
@ -57,6 +57,15 @@ bool SDCard::cardBusy()
|
|||||||
return cardBusy_;
|
return cardBusy_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief End the card to free heap space.
|
||||||
|
void SDCard::terminate()
|
||||||
|
{
|
||||||
|
iSD_->end();
|
||||||
|
#ifdef BUILD_SDSPI
|
||||||
|
ispi_->end();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/// @brief Transfer settings from config file on a SD card to the device.
|
/// @brief Transfer settings from config file on a SD card to the device.
|
||||||
/// @param nvMemory* where to save
|
/// @param nvMemory* where to save
|
||||||
/// @param TSettings* passing a struct is required, to save memory
|
/// @param TSettings* passing a struct is required, to save memory
|
||||||
@ -203,5 +212,6 @@ bool SDCard::loadConfigFile(TSettings* Settings) { return false; }
|
|||||||
bool SDCard::initSDcard() { return false; }
|
bool SDCard::initSDcard() { return false; }
|
||||||
bool SDCard::cardAvailable() { return false; }
|
bool SDCard::cardAvailable() { return false; }
|
||||||
bool SDCard::cardBusy() { return false; }
|
bool SDCard::cardBusy() { return false; }
|
||||||
|
void SDCard::terminate() {};
|
||||||
|
|
||||||
#endif //BUILD_SDMMC
|
#endif //BUILD_SDMMC
|
||||||
|
@ -55,6 +55,7 @@ public:
|
|||||||
bool loadConfigFile(TSettings* Settings);
|
bool loadConfigFile(TSettings* Settings);
|
||||||
bool cardAvailable();
|
bool cardAvailable();
|
||||||
bool cardBusy();
|
bool cardBusy();
|
||||||
|
void terminate();
|
||||||
private:
|
private:
|
||||||
bool initSDcard();
|
bool initSDcard();
|
||||||
bool cardInitialized_;
|
bool cardInitialized_;
|
||||||
|
@ -109,6 +109,9 @@ void init_WifiManager()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Free the memory from SDCard class
|
||||||
|
SDCrd.terminate();
|
||||||
|
|
||||||
// Reset settings (only for development)
|
// Reset settings (only for development)
|
||||||
//wm.resetSettings();
|
//wm.resetSettings();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user