1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/littlefs: fix file buffer size

This commit is contained in:
Vincent Dupont 2018-09-28 12:37:12 +02:00
parent 7bb3e3dcc4
commit 7e47e36e55
4 changed files with 7 additions and 10 deletions

View File

@ -48,7 +48,7 @@ USEMODULE += constfs
# Set file systems specific variables
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)))
SPIFFS_NB_FD ?= 8
CFLAGS += '-DSPIFFS_FS_FD_SPACE_SIZE=(32 * $(SPIFFS_NB_FD))'

View File

@ -184,6 +184,11 @@ static int _format(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;
DEBUG("littlefs: mount: mountp=%p\n", (void *)mountp);

View File

@ -31,14 +31,6 @@ extern "C" {
#include "mtd.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
* @{

View File

@ -1,6 +1,6 @@
USEMODULE += littlefs
# 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)
CFLAGS += -DLFS_NAME_MAX=31