nvs: use CRC8 if cache size is 256

When cache size is 256, we can use CRC8

Signed-off-by: Julien D'Ascenzio <julien.dascenzio@paratronic.fr>
This commit is contained in:
Julien D'Ascenzio 2023-01-23 10:33:21 +01:00 committed by Fabio Baltieri
parent 270668b752
commit 740f915721

View file

@ -25,7 +25,7 @@ static inline size_t nvs_lookup_cache_pos(uint16_t id)
{
size_t pos;
#if CONFIG_NVS_LOOKUP_CACHE_SIZE <= UINT8_MAX
#if CONFIG_NVS_LOOKUP_CACHE_SIZE <= (UINT8_MAX + 1)
/*
* CRC8-CCITT is used for ATE checksums and it also acts well as a hash
* function, so it can be a good choice from the code size perspective.