Skip to content
Snippets Groups Projects
Commit 7e47e36e authored by Vincent Dupont's avatar Vincent Dupont
Browse files

pkg/littlefs: fix file buffer size

parent 7bb3e3dc
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ USEMODULE += constfs ...@@ -48,7 +48,7 @@ USEMODULE += constfs
# Set file systems specific variables # Set file systems specific variables
ifneq (,$(filter littlefs, $(USEMODULE))) ifneq (,$(filter littlefs, $(USEMODULE)))
CFLAGS += -DVFS_FILE_BUFFER_SIZE=52 -DVFS_DIR_BUFFER_SIZE=44 CFLAGS += -DVFS_FILE_BUFFER_SIZE=56 -DVFS_DIR_BUFFER_SIZE=44
else ifneq (,$(filter spiffs, $(USEMODULE))) else ifneq (,$(filter spiffs, $(USEMODULE)))
SPIFFS_NB_FD ?= 8 SPIFFS_NB_FD ?= 8
CFLAGS += '-DSPIFFS_FS_FD_SPACE_SIZE=(32 * $(SPIFFS_NB_FD))' CFLAGS += '-DSPIFFS_FS_FD_SPACE_SIZE=(32 * $(SPIFFS_NB_FD))'
......
...@@ -184,6 +184,11 @@ static int _format(vfs_mount_t *mountp) ...@@ -184,6 +184,11 @@ static int _format(vfs_mount_t *mountp)
static int _mount(vfs_mount_t *mountp) static int _mount(vfs_mount_t *mountp)
{ {
/* if one of the lines below fail to compile you probably need to adjust
vfs buffer sizes ;) */
BUILD_BUG_ON(VFS_DIR_BUFFER_SIZE < sizeof(lfs_dir_t));
BUILD_BUG_ON(VFS_FILE_BUFFER_SIZE < sizeof(lfs_file_t));
littlefs_desc_t *fs = mountp->private_data; littlefs_desc_t *fs = mountp->private_data;
DEBUG("littlefs: mount: mountp=%p\n", (void *)mountp); DEBUG("littlefs: mount: mountp=%p\n", (void *)mountp);
......
...@@ -31,14 +31,6 @@ extern "C" { ...@@ -31,14 +31,6 @@ extern "C" {
#include "mtd.h" #include "mtd.h"
#include "mutex.h" #include "mutex.h"
#if VFS_FILE_BUFFER_SIZE < 52
#error "VFS_FILE_BUFFER_SIZE is too small, at least 52 bytes is required"
#endif
#if VFS_DIR_BUFFER_SIZE < 44
#error "VFS_DIR_BUFFER_SIZE is too small, at least 44 bytes is required"
#endif
/** /**
* @name littlefs configuration * @name littlefs configuration
* @{ * @{
......
USEMODULE += littlefs USEMODULE += littlefs
# Set vfs file and dir buffer sizes # Set vfs file and dir buffer sizes
CFLAGS += -DVFS_FILE_BUFFER_SIZE=52 -DVFS_DIR_BUFFER_SIZE=44 CFLAGS += -DVFS_FILE_BUFFER_SIZE=56 -DVFS_DIR_BUFFER_SIZE=44
# Reduce LFS_NAME_MAX to 31 (as VFS_NAME_MAX default) # Reduce LFS_NAME_MAX to 31 (as VFS_NAME_MAX default)
CFLAGS += -DLFS_NAME_MAX=31 CFLAGS += -DLFS_NAME_MAX=31
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment