native: clean up SPIFFS default config

This commit is contained in:
Vincent Dupont 2017-12-18 13:24:46 +01:00
parent ff0d19b686
commit 0905a99905

View File

@ -79,30 +79,52 @@ 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 defined(MODULE_SPIFFS) || DOXYGEN
/**
* @name SPIFFS default configuration
* @{
*/
/* SPIFFS config flags */
#ifndef SPIFFS_READ_ONLY
#define SPIFFS_READ_ONLY (0)
#endif
#ifndef SPIFFS_SINGLETON
#define SPIFFS_SINGLETON (0)
#endif
#ifndef SPIFFS_HAL_CALLBACK_EXTRA
#define SPIFFS_HAL_CALLBACK_EXTRA (1)
#endif
#ifndef SPIFFS_CACHE
#define SPIFFS_CACHE (1)
#endif
#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)
/* MTD config if singleton is used */
#ifndef SPIFFS_CFG_PHYS_SZ
#define SPIFFS_CFG_PHYS_SZ(ignore) (MTD_SECTOR_SIZE * MTD_SECTOR_NUM)
#endif
#ifndef SPIFFS_CFG_PHYS_ERASE_SZ
#define SPIFFS_CFG_PHYS_ERASE_SZ(ignore) (MTD_SECTOR_SIZE)
#endif
#ifndef SPIFFS_CFG_PHYS_ADDR
#define SPIFFS_CFG_PHYS_ADDR(ignore) (0)
#endif
#ifndef SPIFFS_CFG_LOG_PAGE_SZ
#define SPIFFS_CFG_LOG_PAGE_SZ(ignore) (MTD_PAGE_SIZE)
#endif
#ifndef SPIFFS_CFG_LOG_BLOCK_SZ
#define SPIFFS_CFG_LOG_BLOCK_SZ(ignore) (MTD_SECTOR_SIZE)
#endif
#endif
#if SPIFFS_HAL_CALLBACK_EXTRA == 0
#define SPIFFS_MTD_DEV (MTD_0)
/* Default MTD device if no callback parameter */
#ifndef SPIFFS_MTD_DEV
#define SPIFFS_MTD_DEV (MTD_0)
#endif
#endif
/** @} */
#endif
#ifdef __cplusplus
}