Changed lfs_crc to match more common API

In looking at the common CRC APIs out there, this seemed the most
common. At least more common than the current modified-in-place pointer
API. It also seems to have a slightly better code footprint. I'm blaming
pointer optimization issues.

One downside is that lfs_crc can't report errors, however it was already
assumed that lfs_crc can not error.
This commit is contained in:
Christopher Haster
2018-08-07 14:59:44 -05:00
parent 3b3981eb74
commit 10f45ac02f
3 changed files with 17 additions and 15 deletions

View File

@@ -187,7 +187,7 @@ static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) {
}
// Calculate CRC-32 with polynomial = 0x04c11db7
void lfs_crc(uint32_t *crc, const void *buffer, size_t size);
uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size);
// Allocate memory, only used if buffers are not provided to littlefs
static inline void *lfs_malloc(size_t size) {