summaryrefslogtreecommitdiffstatshomepage
path: root/lib/littlefs/lfs2_util.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-04-05 20:35:49 +1000
committerDamien George <damien.p.george@gmail.com>2020-04-09 15:59:28 +1000
commit7a07e719158c2969721118b17bd7a92c827ac128 (patch)
tree68a0c337c3e3cb29cf4b506ccb543fb2e12b3b55 /lib/littlefs/lfs2_util.h
parentbd5633778f8dce0d71578338926fc6500069429e (diff)
downloadmicropython-7a07e719158c2969721118b17bd7a92c827ac128.tar.gz
micropython-7a07e719158c2969721118b17bd7a92c827ac128.zip
lib/littlefs: Update littlefs2 to v2.2.0.
At commit a049f1318eecbe502549f9d74a41951985fb956f
Diffstat (limited to 'lib/littlefs/lfs2_util.h')
-rw-r--r--lib/littlefs/lfs2_util.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/littlefs/lfs2_util.h b/lib/littlefs/lfs2_util.h
index 0f27073693..70bca717c9 100644
--- a/lib/littlefs/lfs2_util.h
+++ b/lib/littlefs/lfs2_util.h
@@ -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);