Skip to content

Commit 683034d

Browse files
DeepikaCruz Monrreal II
authored andcommitted
Use the same API name to add mbed CRC: lfs_crc
1 parent 4d7fdfc commit 683034d

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

features/storage/filesystem/littlefs/LittleFileSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "lfs_util.h"
2121
#include "MbedCRC.h"
2222

23-
extern "C" void mbed_lfs_crc(uint32_t *crc, const void *buffer, size_t size)
23+
extern "C" void lfs_crc(uint32_t *crc, const void *buffer, size_t size)
2424
{
2525
uint32_t initial_xor = *crc;
2626
MbedCRC<POLY_32BIT_REV_ANSI, 32> ct(initial_xor, 0x0, true, false);

features/storage/filesystem/littlefs/littlefs/lfs_util.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,7 @@
99

1010
// Only compile if user does not provide custom config
1111
#ifndef LFS_CONFIG
12-
13-
#ifdef __MBED__
14-
extern void mbed_lfs_crc(uint32_t *crc, const void *buffer, size_t size);
15-
16-
// Software CRC implementation with small lookup table
17-
void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) {
18-
mbed_lfs_crc(crc, buffer, size);
19-
}
20-
21-
#else
12+
#ifndef __MBED__
2213
void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) {
2314
static const uint32_t rtable[16] = {
2415
0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
@@ -34,5 +25,4 @@ void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) {
3425
}
3526
}
3627
#endif
37-
3828
#endif

0 commit comments

Comments
 (0)