diff --git a/fs/spiffs/Kconfig b/fs/spiffs/Kconfig index 75e125f5e2f..e9345bf5d88 100644 --- a/fs/spiffs/Kconfig +++ b/fs/spiffs/Kconfig @@ -176,4 +176,13 @@ config SPIFFS_COPYBUF_STACK value generates more read/writes. No meaning having it bigger than logical page size. +config SPIFFS_COMPAT_OLD_NUTTX + bool "Compatibility with older NuttX SPIFFS" + default n + ---help--- + Enable the compatiblilty with older NuttX versions. + (Older than NuttX 11.0.0, where this option was introduced.) + + Note: This config affects the on-flash structure. + endif # FS_SPIFFS diff --git a/fs/spiffs/src/spiffs_core.h b/fs/spiffs/src/spiffs_core.h index 0801f6e3ef4..09f71ee00c5 100644 --- a/fs/spiffs/src/spiffs_core.h +++ b/fs/spiffs/src/spiffs_core.h @@ -400,6 +400,10 @@ begin_packed_struct struct spiffs_page_header_s begin_packed_struct struct spiffs_pgobj_ndxheader_s { struct spiffs_page_header_s phdr; /* common page header */ +#ifndef CONFIG_SPIFFS_COMPAT_OLD_NUTTX + uint8_t _align[4 - ((sizeof(struct spiffs_page_header_s) & 3) == + 0 ? 4 : (sizeof(struct spiffs_page_header_s) & 3))]; +#endif uint32_t size; /* size of object */ uint8_t type; /* type of object */ uint8_t name[CONFIG_SPIFFS_NAME_MAX]; /* name of object */