|
18 | 18 | #include <stdint.h>
|
19 | 19 | #include <stdbool.h>
|
20 | 20 | #include <unistd.h>
|
| 21 | +#include <sdkconfig.h> |
| 22 | + |
| 23 | +// Rename defines from menuconfig if present from sdkconfig.h |
| 24 | +#ifdef CONFIG_SPIFFS_USE_MAGIC_LENGTH |
| 25 | +#define SPIFFS_USE_MAGIC_LENGTH CONFIG_SPIFFS_USE_MAGIC_LENGTH |
| 26 | +#endif |
| 27 | +#ifdef CONFIG_SPIFFS_CACHE_WR |
| 28 | +#define SPIFFS_CACHE_WR CONFIG_SPIFFS_CACHE_WR |
| 29 | +#endif |
| 30 | +#ifdef CONFIG_SPIFFS_CACHE |
| 31 | +#define SPIFFS_CACHE CONFIG_SPIFFS_CACHE |
| 32 | +#endif |
| 33 | +#ifdef CONFIG_SPIFFS_META_LENGTH |
| 34 | +#define SPIFFS_META_LENGTH CONFIG_SPIFFS_META_LENGTH |
| 35 | +#endif |
| 36 | +#ifdef CONFIG_SPIFFS_USE_MAGIC |
| 37 | +#define SPIFFS_USE_MAGIC CONFIG_SPIFFS_USE_MAGIC |
| 38 | +#endif |
| 39 | +#ifdef CONFIG_SPIFFS_PAGE_CHECK |
| 40 | +#define SPIFFS_PAGE_CHECK CONFIG_SPIFFS_PAGE_CHECK |
| 41 | +#endif |
| 42 | +#ifdef CONFIG_SPIFFS_USE_MTIME |
| 43 | +#define SPIFFS_USE_MTIME CONFIG_SPIFFS_USE_MTIME |
| 44 | +#endif |
| 45 | +#ifdef CONFIG_SPIFFS_GC_MAX_RUNS |
| 46 | +#define SPIFFS_GC_MAX_RUNS CONFIG_SPIFFS_GC_MAX_RUNS |
| 47 | +#endif |
| 48 | +#ifdef CONFIG_SPIFFS_MAX_PARTITIONS |
| 49 | +#define SPIFFS_MAX_PARTITIONS CONFIG_SPIFFS_MAX_PARTITIONS |
| 50 | +#endif |
| 51 | +#ifdef CONFIG_SPIFFS_OBJ_NAME_LEN |
| 52 | +#define SPIFFS_OBJ_NAME_LEN CONFIG_SPIFFS_OBJ_NAME_LEN |
| 53 | +#endif |
| 54 | +#ifdef CONFIG_SPIFFS_PAGE_SIZE |
| 55 | +#define SPIFFS_PAGE_SIZE CONFIG_SPIFFS_PAGE_SIZE |
| 56 | +#endif |
21 | 57 |
|
22 | 58 | // Set generic spiffs debug output call.
|
23 | 59 | #ifndef SPIFFS_DBG
|
@@ -99,7 +135,9 @@ typedef uint8_t u8_t;
|
99 | 135 | #endif
|
100 | 136 |
|
101 | 137 | // Define maximum number of gc runs to perform to reach desired free pages.
|
| 138 | +#ifndef SPIFFS_GC_MAX_RUNS |
102 | 139 | #define SPIFFS_GC_MAX_RUNS 10
|
| 140 | +#endif |
103 | 141 |
|
104 | 142 | // Enable/disable statistics on gc. Debug/test purpose only.
|
105 | 143 | #ifndef SPIFFS_GC_STATS
|
|
0 commit comments