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