mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-13 13:01:55 +03:00
Make SPIFFS and LittleFS stay out of link when not needed (#6699)
* define two weak functions defaulting to no-op redefine them to do something useful when either spiffs or littlefs are used * noop * single entry point for closing FSes * rename functions, override when instanciated, add link to explanation * spiffs: call end on destructor
This commit is contained in:
@ -5,7 +5,6 @@
|
||||
#include <WiFiUdp.h>
|
||||
#include <flash_hal.h>
|
||||
#include <FS.h>
|
||||
#include <LittleFS.h>
|
||||
#include "StreamString.h"
|
||||
#include "ESP8266HTTPUpdateServer.h"
|
||||
|
||||
@ -94,8 +93,7 @@ void ESP8266HTTPUpdateServerTemplate<ServerType>::setup(ESP8266WebServerTemplate
|
||||
Serial.printf("Update: %s\n", upload.filename.c_str());
|
||||
if (upload.name == "filesystem") {
|
||||
size_t fsSize = ((size_t) &_FS_end - (size_t) &_FS_start);
|
||||
SPIFFS.end();
|
||||
LittleFS.end();
|
||||
close_all_fs();
|
||||
if (!Update.begin(fsSize, U_FS)){//start with max available size
|
||||
if (_serial_output) Update.printError(Serial);
|
||||
}
|
||||
|
Reference in New Issue
Block a user