mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 03:06:33 +00:00
ffsp flash system pointer
This commit is contained in:
parent
40a440d5f2
commit
38a58532c7
@ -70,6 +70,8 @@ The driver enabled by #define USE_UFILESYS
|
||||
|
||||
// global file system pointer
|
||||
FS *ufsp;
|
||||
// flash file system pointer on esp32
|
||||
FS *ffsp;
|
||||
char ufs_path[48];
|
||||
File ufs_upload_file;
|
||||
|
||||
@ -83,6 +85,7 @@ uint8_t ufs_type;
|
||||
|
||||
void UFSInit(void) {
|
||||
ufs_type = 0;
|
||||
ffsp = 0;
|
||||
// check for fs options,
|
||||
// 1. check for SD card
|
||||
// 2. check for littlefs or FAT
|
||||
@ -104,6 +107,16 @@ void UFSInit(void) {
|
||||
ufsp = &SD;
|
||||
#endif // ESP32
|
||||
ufs_type = UFS_TSDC;
|
||||
// now detect ffs
|
||||
ffsp = &LITTLEFS;
|
||||
if (!LITTLEFS.begin()) {
|
||||
// ffat is second
|
||||
ffsp = &FFat;
|
||||
if (!FFat.begin(true)) {
|
||||
ffsp = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -126,10 +139,12 @@ void UFSInit(void) {
|
||||
return;
|
||||
}
|
||||
ufs_type = UFS_TFAT;
|
||||
ffsp = ufsp;
|
||||
return;
|
||||
}
|
||||
#endif // ESP32
|
||||
ufs_type = UFS_TLFS;
|
||||
ffsp = ufsp;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user