1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-24 08:45:10 +03:00
esp8266/cores/esp8266/FSnoop.cpp
david gauchard 6f7eb2828a 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
2019-11-06 21:37:52 -03:00

34 lines
681 B
C++

/*
* no-op implementations
* used/linked when no strong implementation already exists elsewhere
*/
#include <FS.h>
extern "C"
{
void close_all_fs(void)
{
littlefs_request_end();
spiffs_request_end();
}
// default weak definitions
// they are overriden in their respective real implementation
// hint: https://github.com/esp8266/Arduino/pull/6699#issuecomment-549085382
void littlefs_request_end(void) __attribute__((weak));
void littlefs_request_end(void)
{
//ets_printf("debug: noop: littlefs_request_end\n");
}
void spiffs_request_end(void) __attribute__((weak));
void spiffs_request_end(void)
{
//ets_printf("debug: noop: spiffs_request_end\n");
}
}