mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 05:06:39 +01:00
Use SDCard usage where available
When an SD Card is available it is the more interesing metric in terms of space usage. We are therefore using it here. Signed-off-by: Mimoja <git@mimoja.de>
This commit is contained in:
@@ -26,6 +26,7 @@ class DynStorage {
|
||||
DynStorage();
|
||||
void begin();
|
||||
void listFiles();
|
||||
size_t freeSpace();
|
||||
|
||||
private:
|
||||
bool isInited;
|
||||
|
||||
@@ -44,8 +44,13 @@ static void initSDCard() {
|
||||
}
|
||||
#endif
|
||||
|
||||
void copyToSD(FS &sourceFS, const char* source_path){
|
||||
File root = sourceFS.open(source_path);
|
||||
size_t DynStorage::freeSpace(){
|
||||
this->begin();
|
||||
#ifdef HAS_SDCARD
|
||||
return SD.totalBytes() - SD.usedBytes();
|
||||
#endif
|
||||
return LittleFS.totalBytes() - LittleFS.usedBytes();
|
||||
}
|
||||
|
||||
void copyFile(File in, File out) {
|
||||
Serial.print("Copying ");
|
||||
|
||||
@@ -136,7 +136,7 @@ void wsSendSysteminfo() {
|
||||
sys["heap"] = ESP.getFreeHeap();
|
||||
sys["recordcount"] = tagDB.size();
|
||||
sys["dbsize"] = tagDB.size() * sizeof(tagRecord);
|
||||
sys["littlefsfree"] = LittleFS.totalBytes() - LittleFS.usedBytes();
|
||||
sys["littlefsfree"] = Storage.freeSpace();
|
||||
sys["apstate"] = apInfo.state;
|
||||
sys["runstate"] = config.runStatus;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user