Skip to content

Commit 72c2c3f

Browse files
author
Me No Dev
committed
Make SD be able to coexist with SPIFFS
Ideally the library should be reworked to use the same API
1 parent 2c438a5 commit 72c2c3f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

libraries/SD/src/File.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
#include <SD.h>
1616

17+
using namespace sd;
18+
using sd::File;
19+
1720
/* for debugging file open/close leaks
1821
uint8_t nfilecount=0;
1922
*/

libraries/SD/src/SD.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252

5353
#include "SD.h"
5454

55+
using namespace sd;
56+
using sd::File;
57+
5558
// Used by `getNextPathComponent`
5659
#define MAX_COMPONENT_LEN 12 // What is max length?
5760
#define PATH_COMPONENT_BUFFER_LEN MAX_COMPONENT_LEN+1

libraries/SD/src/SD.h

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <utility/SdFat.h>
2121
#include <utility/SdFatUtil.h>
2222

23+
namespace sd {
24+
2325
#define FILE_READ O_READ
2426
#define FILE_WRITE (O_READ | O_WRITE | O_CREAT)
2527

@@ -132,6 +134,10 @@ class SDClass {
132134
friend boolean callback_openPath(SdFile&, char *, boolean, void *);
133135
};
134136

137+
}
138+
139+
using sd::SDClass;
140+
135141
extern SDClass SD;
136142

137143
#endif

0 commit comments

Comments
 (0)