Skip to content

Commit 3b81557

Browse files
tijnkooijmansigrr
authored andcommitted
added macro for maximum open SPIFFS files, settings it to 1 saves about 1k heap. (#2167)
1 parent 3bfd5d5 commit 3b81557

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cores/esp8266/spiffs_api.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,15 @@ extern "C" uint32_t _SPIFFS_block;
120120
#define SPIFFS_PHYS_PAGE ((uint32_t) &_SPIFFS_page)
121121
#define SPIFFS_PHYS_BLOCK ((uint32_t) &_SPIFFS_block)
122122

123+
#ifndef SPIFFS_MAX_OPEN_FILES
124+
#define SPIFFS_MAX_OPEN_FILES 5
125+
#endif
126+
123127
FS SPIFFS = FS(FSImplPtr(new SPIFFSImpl(
124128
SPIFFS_PHYS_ADDR,
125129
SPIFFS_PHYS_SIZE,
126130
SPIFFS_PHYS_PAGE,
127131
SPIFFS_PHYS_BLOCK,
128-
5)));
132+
SPIFFS_MAX_OPEN_FILES)));
129133

130134
#endif

0 commit comments

Comments
 (0)