From 8f7fbe686a02ba3650d919b3a82bd849cc392fba Mon Sep 17 00:00:00 2001 From: Tijn Kooijmans Date: Sat, 18 Jun 2016 21:34:59 +0200 Subject: [PATCH] added macro for maximum open SPIFFS files, settings it to 1 saves about 1k heap. --- cores/esp8266/spiffs_api.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cores/esp8266/spiffs_api.cpp b/cores/esp8266/spiffs_api.cpp index c8a05df060..c366c084b9 100644 --- a/cores/esp8266/spiffs_api.cpp +++ b/cores/esp8266/spiffs_api.cpp @@ -120,11 +120,15 @@ extern "C" uint32_t _SPIFFS_block; #define SPIFFS_PHYS_PAGE ((uint32_t) &_SPIFFS_page) #define SPIFFS_PHYS_BLOCK ((uint32_t) &_SPIFFS_block) +#ifndef SPIFFS_MAX_OPEN_FILES +#define SPIFFS_MAX_OPEN_FILES 5 +#endif + FS SPIFFS = FS(FSImplPtr(new SPIFFSImpl( SPIFFS_PHYS_ADDR, SPIFFS_PHYS_SIZE, SPIFFS_PHYS_PAGE, SPIFFS_PHYS_BLOCK, - 5))); + SPIFFS_MAX_OPEN_FILES))); #endif