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.
This commit is contained in:
Christopher Haster
2018-02-22 13:34:10 -06:00
parent b2124a5ae5
commit 1476181bd1
2 changed files with 20 additions and 0 deletions

View File

@@ -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