lib/littlefs: Update littlefs2 to v2.2.0.

At commit a049f1318eecbe502549f9d74a41951985fb956f
pull/5863/head
Damien George 2020-04-05 20:35:49 +10:00
rodzic bd5633778f
commit 7a07e71915
3 zmienionych plików z 574 dodań i 395 usunięć

Plik diff jest za duży Load Diff

Wyświetl plik

@ -21,7 +21,7 @@ extern "C"
// Software library version
// Major (top-nibble), incremented on backwards incompatible changes
// Minor (bottom-nibble), incremented on feature additions
#define LFS2_VERSION 0x00020001
#define LFS2_VERSION 0x00020002
#define LFS2_VERSION_MAJOR (0xffff & (LFS2_VERSION >> 16))
#define LFS2_VERSION_MINOR (0xffff & (LFS2_VERSION >> 0))
@ -355,6 +355,11 @@ typedef struct lfs2_superblock {
lfs2_size_t attr_max;
} lfs2_superblock_t;
typedef struct lfs2_gstate {
uint32_t tag;
lfs2_block_t pair[2];
} lfs2_gstate_t;
// The littlefs filesystem type
typedef struct lfs2 {
lfs2_cache_t rcache;
@ -369,10 +374,9 @@ typedef struct lfs2 {
} *mlist;
uint32_t seed;
struct lfs2_gstate {
uint32_t tag;
lfs2_block_t pair[2];
} gstate, gpending, gdelta;
lfs2_gstate_t gstate;
lfs2_gstate_t gdisk;
lfs2_gstate_t gdelta;
struct lfs2_free {
lfs2_block_t off;

Wyświetl plik

@ -50,31 +50,35 @@ extern "C"
// Logging functions
#ifdef LFS2_YES_TRACE
#define LFS2_TRACE(fmt, ...) \
printf("lfs2_trace:%d: " fmt "\n", __LINE__, __VA_ARGS__)
#define LFS2_TRACE_(fmt, ...) \
printf("%s:%d:trace: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__)
#define LFS2_TRACE(...) LFS2_TRACE_(__VA_ARGS__, "")
#else
#define LFS2_TRACE(fmt, ...)
#define LFS2_TRACE(...)
#endif
#ifndef LFS2_NO_DEBUG
#define LFS2_DEBUG(fmt, ...) \
printf("lfs2_debug:%d: " fmt "\n", __LINE__, __VA_ARGS__)
#define LFS2_DEBUG_(fmt, ...) \
printf("%s:%d:debug: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__)
#define LFS2_DEBUG(...) LFS2_DEBUG_(__VA_ARGS__, "")
#else
#define LFS2_DEBUG(fmt, ...)
#define LFS2_DEBUG(...)
#endif
#ifndef LFS2_NO_WARN
#define LFS2_WARN(fmt, ...) \
printf("lfs2_warn:%d: " fmt "\n", __LINE__, __VA_ARGS__)
#define LFS2_WARN_(fmt, ...) \
printf("%s:%d:warn: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__)
#define LFS2_WARN(...) LFS2_WARN_(__VA_ARGS__, "")
#else
#define LFS2_WARN(fmt, ...)
#define LFS2_WARN(...)
#endif
#ifndef LFS2_NO_ERROR
#define LFS2_ERROR(fmt, ...) \
printf("lfs2_error:%d: " fmt "\n", __LINE__, __VA_ARGS__)
#define LFS2_ERROR_(fmt, ...) \
printf("%s:%d:error: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__)
#define LFS2_ERROR(...) LFS2_ERROR_(__VA_ARGS__, "")
#else
#define LFS2_ERROR(fmt, ...)
#define LFS2_ERROR(...)
#endif
// Runtime assertions
@ -107,7 +111,7 @@ static inline uint32_t lfs2_alignup(uint32_t a, uint32_t alignment) {
return lfs2_aligndown(a + alignment-1, alignment);
}
// Find the next smallest power of 2 less than or equal to a
// Find the smallest power of 2 greater than or equal to a
static inline uint32_t lfs2_npw2(uint32_t a) {
#if !defined(LFS2_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM))
return 32 - __builtin_clz(a-1);