31 #ifndef SPIFFS_CONFIG_H
32 #define SPIFFS_CONFIG_H
56 #define SPIFFS_DBG(...)
60 #define SPIFFS_GC_DBG(...)
63 #ifndef SPIFFS_CACHE_DBG
64 #define SPIFFS_CACHE_DBG(...)
67 #ifndef SPIFFS_CHECK_DBG
68 #define SPIFFS_CHECK_DBG(...)
71 #ifndef SPIFFS_API_DBG
72 #define SPIFFS_API_DBG(...)
82 #define _SPIPRIad "%08x"
86 #define _SPIPRIbl "%04x"
90 #define _SPIPRIpg "%04x"
94 #define _SPIPRIsp "%04x"
98 #define _SPIPRIfd "%d"
102 #define _SPIPRIid "%04x"
106 #define _SPIPRIfl "%02x"
112 #ifndef SPIFFS_BUFFER_HELP
113 #define SPIFFS_BUFFER_HELP 0
119 #define SPIFFS_CACHE 1
123 #ifndef SPIFFS_CACHE_WR
124 #define SPIFFS_CACHE_WR 1
128 #ifndef SPIFFS_CACHE_STATS
129 #define SPIFFS_CACHE_STATS 1
135 #ifndef SPIFFS_PAGE_CHECK
136 #define SPIFFS_PAGE_CHECK 1
140 #ifndef SPIFFS_GC_MAX_RUNS
141 #define SPIFFS_GC_MAX_RUNS 5
145 #ifndef SPIFFS_GC_STATS
146 #define SPIFFS_GC_STATS 1
158 #ifndef SPIFFS_GC_HEUR_W_DELET
159 #define SPIFFS_GC_HEUR_W_DELET (5)
162 #ifndef SPIFFS_GC_HEUR_W_USED
163 #define SPIFFS_GC_HEUR_W_USED (-1)
167 #ifndef SPIFFS_GC_HEUR_W_ERASE_AGE
168 #define SPIFFS_GC_HEUR_W_ERASE_AGE (50)
174 #ifndef SPIFFS_OBJ_NAME_LEN
175 #define SPIFFS_OBJ_NAME_LEN (32)
188 #ifndef SPIFFS_OBJ_META_LEN
189 #define SPIFFS_OBJ_META_LEN (0)
195 #ifndef SPIFFS_COPY_BUFFER_STACK
196 #define SPIFFS_COPY_BUFFER_STACK (64)
203 #ifndef SPIFFS_USE_MAGIC
204 #define SPIFFS_USE_MAGIC (1)
213 #ifndef SPIFFS_USE_MAGIC_LENGTH
214 #define SPIFFS_USE_MAGIC_LENGTH (0)
227 #define SPIFFS_LOCK(fs) spiffs_lock(fs)
230 #ifndef SPIFFS_UNLOCK
231 #define SPIFFS_UNLOCK(fs) spiffs_unlock(fs)
237 #ifndef SPIFFS_SINGLETON
238 #define SPIFFS_SINGLETON 0
244 #ifndef SPIFFS_CFG_PHYS_SZ
245 #define SPIFFS_CFG_PHYS_SZ(ignore) (1024*1024*2)
247 #ifndef SPIFFS_CFG_PHYS_ERASE_SZ
248 #define SPIFFS_CFG_PHYS_ERASE_SZ(ignore) (65536)
250 #ifndef SPIFFS_CFG_PHYS_ADDR
251 #define SPIFFS_CFG_PHYS_ADDR(ignore) (0)
253 #ifndef SPIFFS_CFG_LOG_PAGE_SZ
254 #define SPIFFS_CFG_LOG_PAGE_SZ(ignore) (256)
256 #ifndef SPIFFS_CFG_LOG_BLOCK_SZ
257 #define SPIFFS_CFG_LOG_BLOCK_SZ(ignore) (65536)
262 #ifndef SPIFFS_ALIGNED_OBJECT_INDEX_TABLES
263 #define SPIFFS_ALIGNED_OBJECT_INDEX_TABLES 1
267 #ifndef SPIFFS_HAL_CALLBACK_EXTRA
268 #define SPIFFS_HAL_CALLBACK_EXTRA 1
277 #ifndef SPIFFS_FILEHDL_OFFSET
278 #define SPIFFS_FILEHDL_OFFSET 0
291 #ifndef SPIFFS_READ_ONLY
292 #define SPIFFS_READ_ONLY 0
298 #ifndef SPIFFS_TEST_VISUALISATION
299 #define SPIFFS_TEST_VISUALISATION 0
301 #if SPIFFS_TEST_VISUALISATION
302 #ifndef spiffs_printf
303 #define spiffs_printf(...) DEBUG(__VA_ARGS__)
306 #ifndef SPIFFS_TEST_VIS_FREE_STR
307 #define SPIFFS_TEST_VIS_FREE_STR "_"
310 #ifndef SPIFFS_TEST_VIS_DELE_STR
311 #define SPIFFS_TEST_VIS_DELE_STR "/"
314 #ifndef SPIFFS_TEST_VIS_INDX_STR
315 #define SPIFFS_TEST_VIS_INDX_STR(id) "i"
318 #ifndef SPIFFS_TEST_VIS_DATA_STR
319 #define SPIFFS_TEST_VIS_DATA_STR(id) "d"
330 typedef uint16_t spiffs_block_ix;
333 typedef uint16_t spiffs_page_ix;
337 typedef uint16_t spiffs_obj_id;
341 typedef uint16_t spiffs_span_ix;
343 typedef uint8_t u8_t;
344 typedef uint32_t u32_t;
345 typedef int32_t s32_t;
346 typedef uint16_t u16_t;
347 typedef int16_t s16_t;
void spiffs_lock(struct spiffs_t *fs)
SPIFFS lock function.
void spiffs_unlock(struct spiffs_t *fs)
SPIFFS unlock function.
stdio wrapper to extend the C libs stdio