1
1
#include < WiFi.h>
2
2
#include < WiFiClient.h>
3
3
#include < WebServer.h>
4
- #include < SD_MMC .h>
4
+ #include < SD .h>
5
5
6
6
#include < uri/UriRegex.h>
7
7
@@ -20,10 +20,10 @@ void handleCreateProcess() {
20
20
String path = server.pathArg (0 );
21
21
HTTPRaw& raw = server.raw ();
22
22
if (raw.status == RAW_START) {
23
- if (SD_MMC .exists ((char *)path.c_str ())) {
24
- SD_MMC .remove ((char *)path.c_str ());
23
+ if (SD .exists ((char *)path.c_str ())) {
24
+ SD .remove ((char *)path.c_str ());
25
25
}
26
- rawFile = SD_MMC .open (path.c_str (), FILE_WRITE);
26
+ rawFile = SD .open (path.c_str (), FILE_WRITE);
27
27
Serial.print (" Upload: START, filename: " );
28
28
Serial.println (path);
29
29
} else if (raw.status == RAW_WRITE) {
@@ -50,10 +50,10 @@ void printDirectory() {
50
50
return returnFail (" BAD ARGS" );
51
51
}
52
52
String path = server.arg (" dir" );
53
- if (path != " /" && !SD_MMC .exists ((char *)path.c_str ())) {
53
+ if (path != " /" && !SD .exists ((char *)path.c_str ())) {
54
54
return returnFail (" BAD PATH" );
55
55
}
56
- File dir = SD_MMC .open ((char *)path.c_str ());
56
+ File dir = SD .open ((char *)path.c_str ());
57
57
path = String ();
58
58
if (!dir.isDirectory ()) {
59
59
dir.close ();
@@ -107,8 +107,8 @@ void handleNotFound() {
107
107
void setup (void ) {
108
108
Serial.begin (115200 );
109
109
110
- while (!SD_MMC .begin ()) delay (10 );
111
- Serial.println (" SD_MMC Card initialized." );
110
+ while (!SD .begin ()) delay (10 );
111
+ Serial.println (" SD Card initialized." );
112
112
113
113
WiFi.mode (WIFI_STA);
114
114
WiFi.begin (ssid, password);
0 commit comments