chart log data wip
This commit is contained in:
parent
cd4ced7f9c
commit
1e30589b5c
1 changed files with 48 additions and 35 deletions
|
@ -826,48 +826,61 @@ void LFS_Chart_Dirlist_Data(const byte chartId) {
|
|||
|
||||
/* FS Implementation of ESP8266 Core and ESP32 Arduino core is different, so it needs to be seperated completely :( */
|
||||
|
||||
#ifdef ESP8266
|
||||
Dir root = LittleFS.openDir(chartDirPath);
|
||||
while (root.next()) {
|
||||
if (root.isFile()) {
|
||||
Serial.print(" FILE : ");
|
||||
Serial.println(root.fileName());
|
||||
}
|
||||
if(root.isDirectory()) {
|
||||
Serial.print(" DIR: ");
|
||||
Serial.print(root.fileName());
|
||||
Serial.print("\tSIZE: ");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//#ifdef ESP8266
|
||||
//Dir root = LittleFS.openDir(chartDirPath);
|
||||
//while (root.next()) {
|
||||
//if (root.isFile()) {
|
||||
//Serial.print(" FILE : ");
|
||||
//Serial.println(root.fileName());
|
||||
//}
|
||||
//if(root.isDirectory()) {
|
||||
//Serial.print(" DIR: ");
|
||||
//Serial.print(root.fileName());
|
||||
//Serial.print("\tSIZE: ");
|
||||
//}
|
||||
//}
|
||||
|
||||
#ifdef ESP32
|
||||
fs::FS &fs = LittleFS;
|
||||
File root = fs.open(chartDirPath);
|
||||
if (!root) {
|
||||
Serial.println("- failed to open directory");
|
||||
//return;
|
||||
}
|
||||
if (!root.isDirectory()) {
|
||||
Serial.println(" - not a directory");
|
||||
//return;
|
||||
}
|
||||
|
||||
File root = LittleFS.open(chartDirPath, "r");
|
||||
File file = root.openNextFile();
|
||||
while (file) {
|
||||
if (file.isDirectory()) {
|
||||
Serial.print(" DIR : ");
|
||||
Serial.println(file.name());
|
||||
|
||||
} else {
|
||||
Serial.print(" FILE: ");
|
||||
while (file) {
|
||||
//Serial.printf("|__ FILE: %s (%d bytes)\n",file.name(), file.size());
|
||||
if (!file.isDirectory()) {
|
||||
Serial.print(" FILE : ");
|
||||
Serial.print(file.name());
|
||||
Serial.print("\tSIZE: ");
|
||||
Serial.println(file.size());
|
||||
}
|
||||
}
|
||||
file = root.openNextFile();
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
//#ifdef ESP32
|
||||
//fs::FS &fs = LittleFS;
|
||||
//File root = fs.open(chartDirPath);
|
||||
//if (!root) {
|
||||
//Serial.println("- failed to open directory");
|
||||
|
||||
//}
|
||||
//if (!root.isDirectory()) {
|
||||
//Serial.println(" - not a directory");
|
||||
|
||||
//}
|
||||
|
||||
//File file = root.openNextFile();
|
||||
//while (file) {
|
||||
//if (file.isDirectory()) {
|
||||
//Serial.print(" DIR : ");
|
||||
//Serial.println(file.name());
|
||||
|
||||
//} else {
|
||||
//Serial.print(" FILE: ");
|
||||
//Serial.print(file.name());
|
||||
//Serial.print("\tSIZE: ");
|
||||
//Serial.println(file.size());
|
||||
//}
|
||||
//file = root.openNextFile();
|
||||
//}
|
||||
//#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue