mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 05:06:32 +00:00
spiffs
This commit is contained in:
parent
a8fbdcabd3
commit
9c9d7e0eef
@ -105,7 +105,7 @@ void UFSInit(void) {
|
|||||||
#else
|
#else
|
||||||
ufsp = &SD;
|
ufsp = &SD;
|
||||||
#endif
|
#endif
|
||||||
ufs_type = 1;
|
ufs_type = UFS_TSDC;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -119,10 +119,17 @@ void UFSInit(void) {
|
|||||||
#else
|
#else
|
||||||
ufsp = &FFat;
|
ufsp = &FFat;
|
||||||
if (!FFat.begin(true)) {
|
if (!FFat.begin(true)) {
|
||||||
|
if (!SPIFFS.begin(true)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ufsp = &SPIFFS;
|
||||||
|
ufs_type = UFS_TSPIFFS;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
ufs_type = 2;
|
ufs_type = UFS_TFAT;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,9 +166,14 @@ uint32_t result = 0;
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case UFS_TSPIFFS:
|
case UFS_TSPIFFS:
|
||||||
|
if (sel == 0) {
|
||||||
|
result = SPIFFS.totalBytes();
|
||||||
|
} else {
|
||||||
|
result = SPIFFS.totalBytes() - SPIFFS.usedBytes();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return result / 10000;
|
return result / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_LONG_FILE_NAMES>0
|
#if USE_LONG_FILE_NAMES>0
|
||||||
@ -373,6 +385,10 @@ uint8_t UFS_DownloadFile(char *file) {
|
|||||||
File download_file;
|
File download_file;
|
||||||
WiFiClient download_Client;
|
WiFiClient download_Client;
|
||||||
|
|
||||||
|
AddLog_P(LOG_LEVEL_INFO, PSTR("file not found %s"),file);
|
||||||
|
|
||||||
|
if (*file == '/') file++;
|
||||||
|
|
||||||
if (!ufsp->exists(file)) {
|
if (!ufsp->exists(file)) {
|
||||||
AddLog_P(LOG_LEVEL_INFO, PSTR("file not found"));
|
AddLog_P(LOG_LEVEL_INFO, PSTR("file not found"));
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user