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>2018-02-22 22:34:10 +0300
committerChristopher Haster <chaster@utexas.edu>2018-02-22 22:39:24 +0300
commit1476181bd17b4d9998b618f115fe64f3b86af0a5 (patch)
treec1df96a6b4923d47bd3484196817466db7370477 /lfs_util.c
parentb2124a5ae54717737f6d96cb24e6f31e02158d1e (diff)
Added LFS_CONFIG for user provided configuration of the utils
Suggested by sn00pster, LFS_CONFIG is an opt-in user provided configuration file that will override the util implementation in lfs_util.h. This is useful for allowing system-specific overrides without needing to rely on git merges or other forms of patching for updates.
Diffstat (limited to 'lfs_util.c')
-rw-r--r--lfs_util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lfs_util.c b/lfs_util.c
index 567977b..3a2a351 100644
--- a/lfs_util.c
+++ b/lfs_util.c
@@ -17,7 +17,11 @@
*/
#include "lfs_util.h"
+// Only compile if user does not provide custom config
+#ifndef LFS_CONFIG
+
+// Software CRC implementation with small lookup table
void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) {
static const uint32_t rtable[16] = {
0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
@@ -34,3 +38,5 @@ void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) {
}
}
+
+#endif