Skip to content

Commit 30df497

Browse files
committed
Limit the max open files on fat variant, takes a lot of RAM otherwise (10 are default)
Added missing icon
1 parent 1f3541b commit 30df497

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,16 @@ void setup(){
157157

158158
MDNS.addService("http","tcp",80);
159159

160-
MYFS.begin();
160+
//FS
161+
#ifdef USE_FatFS
162+
if (MYFS.begin(false,"/ffat",3)) { //limit the RAM usage, bottom line 8kb + 4kb takes per each file, default is 10
163+
#else
164+
if (MYFS.begin()) {
165+
#endif
166+
Serial.print(F("FS mounted\n"));
167+
} else {
168+
Serial.print(F("FS mount failed\n"));
169+
}
161170

162171
ws.onEvent(onWsEvent);
163172
server.addHandler(&ws);
6.16 KB
Binary file not shown.

examples/SmartSwitch/SmartSwitch.ino

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ Use latest ESP core lib (from Github)
6464
#include <AsyncTCP.h>
6565
#elif defined(ESP8266)
6666
#ifdef USE_LittleFS
67-
#include <FS.h>
67+
#include <FS.h>
6868
#define HSTNM "ssw8266-littlefs"
69-
#define MYFS LittleFS
70-
#include <LittleFS.h>
69+
#define MYFS LittleFS
70+
#include <LittleFS.h>
7171
#elif defined(USE_FatFS)
7272
#error "FatFS only on ESP32 for now!"
7373
#else
@@ -550,10 +550,14 @@ void setup(){
550550
Serial.printf("Temp set %+2.1f\n", ee.tempe);
551551

552552
//FS
553+
#ifdef USE_FatFS
554+
if (MYFS.begin(false,"/ffat",3)) { //limit the RAM usage, bottom line 8kb + 4kb takes per each file, default is 10
555+
#else
553556
if (MYFS.begin()) {
557+
#endif
554558
Serial.print(F("FS mounted\n"));
555559
} else {
556-
Serial.print(F("FS mount failed\n"));
560+
Serial.print(F("FS mount failed\n"));
557561
}
558562

559563
#ifdef USE_AUTH_WS

0 commit comments

Comments
 (0)