Skip to content

Commit 10139db

Browse files
committed
sdfat tweak (probably broken since __has_include can no longer be undef'd)
1 parent 4698e77 commit 10139db

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/workflows/ArduinoBuild.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- 3.3.0
2828

2929
matrix-context:
30-
#- M5Core2-test
30+
- M5Core2-test
3131
- M5Stack-test
3232
- M5StickC-test
3333
- LGFX-test
@@ -37,7 +37,7 @@ jobs:
3737
- M5Core2
3838
- M5Fire
3939
- OdroidGo
40-
- SdFat-test
40+
#- SdFat-test
4141

4242
include:
4343

@@ -51,7 +51,7 @@ jobs:
5151
- { matrix-context: S3Box-Test, arduino-board: esp32s3box, sketch-names: M5Unified.ino, required-libraries: "M5Unified,M5GFX", ... }
5252
- { matrix-context: M5StickC-test, arduino-board: m5stack_stickc, sketch-names: M5StickC-SPIFFS-Loader-Snippet.ino, required-libraries: "M5StickC", ... }
5353
- { matrix-context: LGFX-test, arduino-board: m5stack_core, sketch-names: LGFX-SDLoader-Snippet.ino, required-libraries: "LovyanGFX", ... }
54-
- { matrix-context: SdFat-test, arduino-board: m5stack_core2, sketch-names: SdFatUpdater.ino, required-libraries: "SdFat,M5GFX,M5Unified", ... }
54+
#- { matrix-context: SdFat-test, arduino-board: m5stack_core2, sketch-names: SdFatUpdater.ino, required-libraries: "SdFat,M5GFX,M5Unified", ... }
5555

5656
# Launcher and Appstore # TODO: add https://github.com/shikarunochi/CardputerSimpleLaucher
5757
- matrix-context: M5Stack
@@ -80,13 +80,13 @@ jobs:
8080
extra-fqbn: ":PartitionScheme=min_spiffs"
8181
required-libraries: "M5Unified,M5GFX,ArduinoJson,Button2"
8282
- matrix-context: M5Atom
83-
sdk-version: latest
83+
sdk-version: 3.3.0
8484
arduino-board: m5stack_atom
8585
sketch-names: M5Stack-SD-Menu.ino
8686
launcher-name: M5Atom-Launcher
8787
required-libraries: "M5Unified,M5GFX,ArduinoJson,Button2"
8888
- matrix-context: M5CoreS3
89-
sdk-version: latest
89+
sdk-version: 3.3.0
9090
arduino-board: m5stack_cores3
9191
sketch-names: M5Stack-FW-Menu.ino
9292
launcher-name: M5CoreS3-Launcher

src/FS/sdfat.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@
1616
#include "../misc/config.h"
1717
#include "../misc/types.h"
1818

19-
#undef __has_include // tell SdFat to define 'File' object needed to convert access mode to flag
19+
#define old_include(x) __has_include__(x)
20+
// NOTE: this is a code smell, see https://github.com/adafruit/SdFat/blob/daa55e618c88a0e3c72ed3a5c97aecd9322a4fa7/src/SdFat.h#L446
21+
#undef __has_include // the only way to tell SdFat to define 'File' object (needed to convert access mode to flag)
22+
// #define HAS_INCLUDE_FS_H
23+
#define SDFAT_FILE_TYPE 3
24+
#include <SdFat.h>
25+
2026
#include <FS.h>
2127
#include <FSImpl.h>
22-
#include <SdFat.h>
23-
#define __has_include(STR) __has_include__(STR) // kudos to @GOB52 for this trick
28+
29+
#define __has_include(x) old_include(x) // kudos to @GOB52 for this trick
2430

2531
// cfr https://en.cppreference.com/w/c/io/fopen + guesses
2632
inline oflag_t _convert_access_mode_to_flag(const char* mode, const bool create = false)

0 commit comments

Comments
 (0)