Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions cores/esp8266/FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,6 @@ class FSConfig
bool _autoFormat;
};

class SPIFFSConfig : public FSConfig
{
public:
static constexpr uint32_t FSId = 0x53504946;
SPIFFSConfig(bool autoFormat = true) : FSConfig(FSId, autoFormat) { }

// Inherit _type and _autoFormat
// nothing yet, enableTime TBD when SPIFFS has metadate
};

class FS
{
public:
Expand Down Expand Up @@ -279,11 +269,6 @@ using fs::SeekCur;
using fs::SeekEnd;
using fs::FSInfo;
using fs::FSConfig;
using fs::SPIFFSConfig;
#endif //FS_NO_GLOBALS

#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SPIFFS)
extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
#endif

#endif //FS_H
5 changes: 3 additions & 2 deletions libraries/FSTools/FSTools.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "FSTools.h"
#include "LittleFS.h"
#include <spiffs_api.h>

#include <LittleFS.h>
#include <SPIFFS.h>
#include <Esp.h>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <ArduinoOTA.h>
#include <FSTools.h>
#include <LittleFS.h>
#include <SPIFFS.h>


#define TARGET_FS_LAYOUT FST::layout_4m3m
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions libraries/SPIFFS/library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name=SPIFFS
version=1
author=esp8266/Arduino
maintainer=esp8266/Arduino
sentence=Port of SPIFFS to ESP8266 Arduino
paragraph=[DEPRECATED] Please consider moving to LittleFS or other filesystems
category=Data Storage
url=https://github.com/esp8266/Arduino/tree/master/libraries/SPIFFS
architectures=esp8266
dot_a_linkage=true
includes=SPIFFS.h
7 changes: 7 additions & 0 deletions libraries/SPIFFS/src/SPIFFS.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include "spiffs_api.h"

#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SPIFFS)
extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
#endif
File renamed without changes.
35 changes: 26 additions & 9 deletions cores/esp8266/spiffs_api.h → libraries/SPIFFS/src/spiffs_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,35 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <limits>
#include "FS.h"
#include "FSImpl.h"
#include <FS.h>
#include <FSImpl.h>
extern "C" {
#include "spiffs/spiffs.h"
#include "spiffs/spiffs_nucleus.h"
#include "../lib/spiffs/spiffs.h"
#include "../lib/spiffs/spiffs_nucleus.h"
};
#include "debug.h"
#include "flash_utils.h"
#include "flash_hal.h"
#include <debug.h>
#include <flash_utils.h>
#include <flash_hal.h>

namespace fs {

class SPIFFSConfig : public FSConfig
{
public:
static constexpr uint32_t FSId = 0x53504946;
SPIFFSConfig(bool autoFormat = true) : FSConfig(FSId, autoFormat) { }

// Inherit _type and _autoFormat
// nothing yet, enableTime TBD when SPIFFS has metadate
};

} // namespace fs

using fs::SPIFFSConfig;

using namespace fs;
using namespace fs; // ?

// The following are deprecated symbols and functions, to be removed at the next major release.
// They are provided only for backwards compatibility and to give libs a chance to update.
Expand Down Expand Up @@ -600,6 +617,6 @@ class SPIFFSDirImpl : public DirImpl
bool _valid;
};

}; // namespace
} // namespace spiffs_impl

#endif //spiffs_api_h
1 change: 1 addition & 0 deletions libraries/SPIFFS/src/spiffs_cache.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../lib/spiffs/spiffs_cache.cpp"
1 change: 1 addition & 0 deletions libraries/SPIFFS/src/spiffs_check.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../lib/spiffs/spiffs_check.cpp"
1 change: 1 addition & 0 deletions libraries/SPIFFS/src/spiffs_gc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../lib/spiffs/spiffs_gc.cpp"
1 change: 1 addition & 0 deletions libraries/SPIFFS/src/spiffs_hydrogen.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../lib/spiffs/spiffs_hydrogen.cpp"
1 change: 1 addition & 0 deletions libraries/SPIFFS/src/spiffs_nucleus.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../lib/spiffs/spiffs_nucleus.cpp"
22 changes: 12 additions & 10 deletions tests/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,8 @@ CORE_CPP_FILES := \
Print.cpp \
stdlib_noniso.cpp \
FS.cpp \
spiffs_api.cpp \
MD5Builder.cpp \
../../libraries/LittleFS/src/LittleFS.cpp \
core_esp8266_noniso.cpp \
spiffs/spiffs_cache.cpp \
spiffs/spiffs_check.cpp \
spiffs/spiffs_gc.cpp \
spiffs/spiffs_hydrogen.cpp \
spiffs/spiffs_nucleus.cpp \
libb64/cencode.cpp \
libb64/cdecode.cpp \
Schedule.cpp \
Expand All @@ -118,6 +111,15 @@ CORE_CPP_FILES := \
Updater.cpp \
time.cpp \
) \
$(addprefix $(abspath $(LIBRARIES_PATH))/, \
LittleFS/src/LittleFS.cpp \
SPIFFS/src/spiffs_api.cpp \
SPIFFS/lib/spiffs/spiffs_cache.cpp \
SPIFFS/lib/spiffs/spiffs_check.cpp \
SPIFFS/lib/spiffs/spiffs_gc.cpp \
SPIFFS/lib/spiffs/spiffs_hydrogen.cpp \
SPIFFS/lib/spiffs/spiffs_nucleus.cpp \
) \
$(addprefix $(abspath $(LIBRARIES_PATH)/ESP8266SdFat/src)/, \
FatLib/FatFile.cpp \
FatLib/FatFileLFN.cpp \
Expand All @@ -139,9 +141,9 @@ CORE_CPP_FILES := \
$(abspath $(LIBRARIES_PATH)/SD/src/SD.cpp) \

CORE_C_FILES := \
$(addprefix $(abspath $(CORE_PATH))/,\
../../libraries/LittleFS/src/lfs.c \
../../libraries/LittleFS/src/lfs_util.c \
$(addprefix $(abspath $(LIBRARIES_PATH))/,\
LittleFS/src/lfs.c \
LittleFS/src/lfs_util.c \
)

MOCK_CPP_FILES_COMMON := \
Expand Down
5 changes: 1 addition & 4 deletions tests/host/common/littlefs_mock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
*/

#include "littlefs_mock.h"
#include "spiffs_mock.h"
#include "spiffs/spiffs.h"
#include "debug.h"
#include <flash_utils.h>
#include <stdlib.h>
#include <LittleFS.h>

#include <spiffs_api.h>
#include <LittleFS.h>

#include <sys/types.h>
#include <sys/stat.h>
Expand Down
3 changes: 1 addition & 2 deletions tests/host/common/spiffs_mock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
*/

#include "spiffs_mock.h"
#include "spiffs/spiffs.h"
#include "debug.h"
#include <flash_utils.h>
#include <stdlib.h>

#include <spiffs_api.h>
#include <SPIFFS.h>

#include <sys/types.h>
#include <sys/stat.h>
Expand Down
1 change: 0 additions & 1 deletion tests/host/core/test_Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <FS.h>
#include <LittleFS.h>
#include "../common/littlefs_mock.h"
#include <spiffs/spiffs.h>

// Use a LittleFS file because we can't instantiate a virtual class like Print
TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
Expand Down
2 changes: 1 addition & 1 deletion tests/host/fs/test_fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "../common/spiffs_mock.h"
#include "../common/littlefs_mock.h"
#include "../common/sdfs_mock.h"
#include <spiffs/spiffs.h>
#include <SPIFFS.h>
#include <LittleFS.h>
#include "../../../libraries/SDFS/src/SDFS.h"
#include "../../../libraries/SD/src/SD.h"
Expand Down
Loading