build: clean up the mess of ifdefs from platform into a scons-configured hal

This commit is contained in:
Torrie Fischer
2023-12-20 10:47:26 +01:00
parent 236795917a
commit 23993a09cf
21 changed files with 376 additions and 410 deletions

View File

@@ -6,10 +6,10 @@ filename_iterator::filename_iterator()
{}
filename_iterator::filename_iterator(const char* path, const char* suffix)
#ifdef BOARD_ESP8266
#ifdef ESP8266
: dir(LittleFS.openDir(path)),
#endif
#ifdef BOARD_ESP32
#ifdef ESP32
: dir(LittleFS.open(path)),
#endif
valid(true),
@@ -26,7 +26,7 @@ filename_iterator::next()
}
int extPos = -1;
do {
#ifdef BOARD_ESP8266
#ifdef ESP8266
valid = dir.next();
if (valid) {
String fname = dir.fileName();
@@ -36,7 +36,7 @@ filename_iterator::next()
}
}
#endif
#ifdef BOARD_ESP32
#ifdef ESP32
File next = dir.openNextFile();
valid = (bool)next;
if (valid && !next.isDirectory()) {