Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2017-09-25 02:20:52 +0300
committerChristopher Haster <chaster@utexas.edu>2017-10-10 13:05:26 +0300
commit9db1a86498250ad078eadc7315f02b24e1a4e9a3 (patch)
tree2dca3a8eb38fd76a4193dcb479268dd8f68de9da /lfs_util.h
parent984340225befc1e2330dd3b88f4048373eda0fce (diff)
Added specification document
For covering all the technical bits
Diffstat (limited to 'lfs_util.h')
-rw-r--r--lfs_util.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/lfs_util.h b/lfs_util.h
index 95706d1..b6e9e35 100644
--- a/lfs_util.h
+++ b/lfs_util.h
@@ -12,7 +12,8 @@
#include <stdio.h>
-// Builtin functions
+// Builtin functions, these may be replaced by more
+// efficient implementations in the system
static inline uint32_t lfs_max(uint32_t a, uint32_t b) {
return (a > b) ? a : b;
}
@@ -33,10 +34,12 @@ static inline int lfs_scmp(uint32_t a, uint32_t b) {
return (int)(unsigned)(a - b);
}
+// CRC-32 with polynomial = 0x04c11db7
void lfs_crc(uint32_t *crc, const void *buffer, size_t size);
-// Logging functions
+// Logging functions, these may be replaced by system-specific
+// logging functions
#define LFS_DEBUG(fmt, ...) printf("lfs debug: " fmt "\n", __VA_ARGS__)
#define LFS_WARN(fmt, ...) printf("lfs warn: " fmt "\n", __VA_ARGS__)
#define LFS_ERROR(fmt, ...) printf("lfs error: " fmt "\n", __VA_ARGS__)