Replace SD card storage with on-board Flash filesystem (FFat), allocating 9MB internal storage partition for keepsakes

This commit is contained in:
drjones
2026-07-04 23:21:44 -07:00
parent e7f2f09819
commit 778a2f4bfe
5 changed files with 22 additions and 35 deletions

View File

@@ -989,7 +989,7 @@ static void handleUploadFile(const String& subdir, bool (*validator)(const Strin
return;
}
pendingUploadPath = "/" + subdir + "/" + fname;
uploadFile = SD_MMC.open(pendingUploadPath, "w");
uploadFile = FFat.open(pendingUploadPath, "w");
uploadSuccess = (bool)uploadFile;
if (uploadSuccess) uploadedFilename = fname;
printf("Upload: writing to %s\r\n", pendingUploadPath.c_str());
@@ -1170,7 +1170,7 @@ void initWebServer() {
}
if (name.isEmpty()) { server.send(404, "text/plain", "Not found"); return; }
String path = "/photos/" + name;
File f = SD_MMC.open(path, "r");
File f = FFat.open(path, "r");
if (!f) { server.send(404, "text/plain", "Not found"); return; }
server.streamFile(f, "image/png");
f.close();
@@ -1181,7 +1181,7 @@ void initWebServer() {
if (uri.startsWith("/photo/")) {
String name = uri.substring(7);
String path = "/photos/" + name;
File f = SD_MMC.open(path, "r");
File f = FFat.open(path, "r");
if (f) {
String ct = name.endsWith(".png") ? "image/png" : "image/jpeg";
server.streamFile(f, ct);