From a0ad63b47e9a75bda98cbf83688fea3225f90fa2 Mon Sep 17 00:00:00 2001 From: Deepika Date: Tue, 21 Aug 2018 17:18:34 -0500 Subject: [PATCH] Use the same API name to add mbed CRC: lfs_crc --- .../storage/filesystem/littlefs/LittleFileSystem.cpp | 2 +- .../storage/filesystem/littlefs/littlefs/lfs_util.c | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/features/storage/filesystem/littlefs/LittleFileSystem.cpp b/features/storage/filesystem/littlefs/LittleFileSystem.cpp index 1fa74bafec..8e17af9a2f 100644 --- a/features/storage/filesystem/littlefs/LittleFileSystem.cpp +++ b/features/storage/filesystem/littlefs/LittleFileSystem.cpp @@ -20,7 +20,7 @@ #include "lfs_util.h" #include "MbedCRC.h" -extern "C" void mbed_lfs_crc(uint32_t *crc, const void *buffer, size_t size) +extern "C" void lfs_crc(uint32_t *crc, const void *buffer, size_t size) { uint32_t initial_xor = *crc; MbedCRC ct(initial_xor, 0x0, true, false); diff --git a/features/storage/filesystem/littlefs/littlefs/lfs_util.c b/features/storage/filesystem/littlefs/littlefs/lfs_util.c index b63e0ad5e8..113632b66b 100644 --- a/features/storage/filesystem/littlefs/littlefs/lfs_util.c +++ b/features/storage/filesystem/littlefs/littlefs/lfs_util.c @@ -9,16 +9,7 @@ // Only compile if user does not provide custom config #ifndef LFS_CONFIG - -#ifdef __MBED__ -extern void mbed_lfs_crc(uint32_t *crc, const void *buffer, size_t size); - -// Software CRC implementation with small lookup table -void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) { - mbed_lfs_crc(crc, buffer, size); -} - -#else +#ifndef __MBED__ void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) { static const uint32_t rtable[16] = { 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, @@ -34,5 +25,4 @@ void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) { } } #endif - #endif \ No newline at end of file