File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed
ESP8266HTTPUpdateServer/src Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,12 @@ class FS
245
245
246
246
} // namespace fs
247
247
248
+ extern " C"
249
+ {
250
+ void littlefs_weak_end (void );
251
+ void spiffs_weak_end (void );
252
+ }
253
+
248
254
#ifndef FS_NO_GLOBALS
249
255
using fs::FS;
250
256
using fs::File;
Original file line number Diff line number Diff line change @@ -127,6 +127,12 @@ bool isSpiffsFilenameValid(const char* name)
127
127
128
128
}; // namespace
129
129
130
+ extern " C" void spiffs_weak_end (void )
131
+ {
132
+ // ets_printf("debug: not weak spiffs end\n");
133
+ SPIFFS.end ();
134
+ }
135
+
130
136
// these symbols should be defined in the linker script for each flash layout
131
137
#ifndef CORE_MOCK
132
138
#ifdef ARDUINO
Original file line number Diff line number Diff line change 5
5
#include < WiFiUdp.h>
6
6
#include < flash_hal.h>
7
7
#include < FS.h>
8
- #include < LittleFS.h>
9
8
#include " StreamString.h"
10
9
#include " ESP8266HTTPUpdateServer.h"
11
10
@@ -94,8 +93,8 @@ void ESP8266HTTPUpdateServerTemplate<ServerType>::setup(ESP8266WebServerTemplate
94
93
Serial.printf (" Update: %s\n " , upload.filename .c_str ());
95
94
if (upload.name == " filesystem" ) {
96
95
size_t fsSize = ((size_t ) &_FS_end - (size_t ) &_FS_start);
97
- SPIFFS. end ();
98
- LittleFS. end ();
96
+ spiffs_weak_end ();
97
+ littlefs_weak_end ();
99
98
if (!Update.begin (fsSize, U_FS)){// start with max available size
100
99
if (_serial_output) Update.printError (Serial);
101
100
}
Original file line number Diff line number Diff line change @@ -181,6 +181,12 @@ int LittleFSImpl::lfs_flash_sync(const struct lfs_config *c) {
181
181
182
182
}; // namespace
183
183
184
+ extern " C" void littlefs_weak_end (void )
185
+ {
186
+ // ets_printf("debug: not weak littlefs end\n");
187
+ LittleFS.end ();
188
+ }
189
+
184
190
// these symbols should be defined in the linker script for each flash layout
185
191
#ifndef CORE_MOCK
186
192
#ifdef ARDUINO
You can’t perform that action at this time.
0 commit comments