1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-03 03:13:25 +02:00

More sd_close() to free memory

This commit is contained in:
Mitch Bradley
2020-10-01 09:44:24 -10:00
parent 71bf7dadd0
commit 6828cbc9fe
2 changed files with 4 additions and 0 deletions

View File

@@ -1348,6 +1348,7 @@ namespace WebUI {
s += path; s += path;
s += " does not exist on SD Card\"}"; s += " does not exist on SD Card\"}";
_webserver->send(200, "application/json", s); _webserver->send(200, "application/json", s);
sd_close();
return; return;
} }
if (list_files) { if (list_files) {
@@ -1426,6 +1427,7 @@ namespace WebUI {
_webserver->send(200, "application/json", jsonfile); _webserver->send(200, "application/json", jsonfile);
_upload_status = UploadStatusType::NONE; _upload_status = UploadStatusType::NONE;
set_sd_state(SDCARD_IDLE); set_sd_state(SDCARD_IDLE);
sd_close();
} }
//SD File upload with direct access to SD/////////////////////////////// //SD File upload with direct access to SD///////////////////////////////
@@ -1543,6 +1545,7 @@ namespace WebUI {
if (sdUploadFile) { if (sdUploadFile) {
sdUploadFile.close(); sdUploadFile.close();
} }
sd_close();
return; return;
} }
} }

View File

@@ -737,6 +737,7 @@ namespace WebUI {
ssd += " Total:" + ESPResponseStream::formatBytes(SD.totalBytes()); ssd += " Total:" + ESPResponseStream::formatBytes(SD.totalBytes());
ssd += "]"; ssd += "]";
webPrintln(ssd); webPrintln(ssd);
sd_close();
return Error::Ok; return Error::Ok;
} }
#endif #endif