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
7 changes: 7 additions & 0 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,13 @@ ifneq (,$(filter sock_dns,$(USEMODULE)))
USEMODULE += sock_util
endif

ifneq (,$(filter spiffs,$(USEMODULE)))
USEPKG += spiffs
USEMODULE += vfs
USEMODULE += spiffs_fs
USEMODULE += mtd
endif

# include package dependencies
-include $(USEPKG:%=$(RIOTPKG)/%/Makefile.dep)

Expand Down
25 changes: 25 additions & 0 deletions boards/native/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,31 @@ void _native_LED_RED_TOGGLE(void);
extern mtd_dev_t *mtd0;
#endif

#ifdef MODULE_SPIFFS
#define SPIFFS_READ_ONLY 0
#define SPIFFS_SINGLETON 0

#define SPIFFS_HAL_CALLBACK_EXTRA 1

#define SPIFFS_CACHE 1

#if SPIFFS_SINGLETON == 1
#define SPIFFS_CFG_PHYS_SZ(ignore) (0x800000)

#define SPIFFS_CFG_PHYS_ERASE_SZ(ignore) (4096)

#define SPIFFS_CFG_PHYS_ADDR(ignore) (0)

#define SPIFFS_CFG_LOG_PAGE_SZ(ignore) (256)

#define SPIFFS_CFG_LOG_BLOCK_SZ(ignore) (4096)
#endif

#if SPIFFS_HAL_CALLBACK_EXTRA == 0
#define SPIFFS_MTD_DEV (MTD_0)
#endif
#endif

#ifdef __cplusplus
}
#endif
Expand Down
19 changes: 19 additions & 0 deletions pkg/spiffs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
PKG_NAME=spiffs
PKG_URL=https://github.com/pellepl/spiffs.git
PKG_VERSION=39937743fbbec4b82308ee08332bf9180408d23b
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any new updates upstream which we should add?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the last release (v0.3.6) I'm not sure we should use a random commit from the master branch. I'd say we stick to this one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I did not see the tag on the Github mobile page. I agree this is the commit we should use.

PKG_BUILDDIR ?= $(PKGDIRBASE)/$(PKG_NAME)

CFLAGS += -std=c11

.PHONY: all

all: git-download
@mkdir -p "$(PKG_BUILDDIR)/riotbuild"
@cp $(PKG_BUILDDIR)/src/*.c $(PKG_BUILDDIR)/src/*.h $(PKG_BUILDDIR)/riotbuild

@echo 'MODULE:=spiffs' > $(PKG_BUILDDIR)/riotbuild/Makefile
@echo 'include $$(RIOTBASE)/Makefile.base' >> $(PKG_BUILDDIR)/riotbuild/Makefile

"$(MAKE)" -C $(PKG_BUILDDIR)/riotbuild

include $(RIOTBASE)/pkg/pkg.mk
6 changes: 6 additions & 0 deletions pkg/spiffs/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
INCLUDES += -I$(RIOTPKG)/spiffs/include
INCLUDES += -I$(PKGDIRBASE)/spiffs/riotbuild/

ifneq (,$(filter spiffs_fs,$(USEMODULE)))
DIRS += $(RIOTBASE)/pkg/spiffs/fs
endif
3 changes: 3 additions & 0 deletions pkg/spiffs/fs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE := spiffs_fs

include $(RIOTBASE)/Makefile.base
Loading