bugfix: reading expired content need in expired range

By obtaining the erase value to set the nvs special ID
instead of using a fixed value

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
This commit is contained in:
zhaoxingyu1
2024-12-12 18:44:06 +08:00
committed by GUIDINGLI
parent 61f4bd522c
commit c4cf7ead30
+2 -1
View File
@@ -201,7 +201,8 @@ static inline size_t nvs_buffer_size(FAR struct nvs_fs *fs)
static inline bool nvs_ate_expired(FAR struct nvs_fs *fs,
FAR struct nvs_ate *entry)
{
return entry->expired[nvs_align_up(fs, sizeof(*entry))] != fs->erasestate;
return entry->expired[nvs_align_up(fs, sizeof(*entry)) - sizeof(*entry)] !=
fs->erasestate;
}
/****************************************************************************