diff options
Diffstat (limited to 'os/hal/lib/complex/mfs/mfs.c')
-rw-r--r-- | os/hal/lib/complex/mfs/mfs.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/os/hal/lib/complex/mfs/mfs.c b/os/hal/lib/complex/mfs/mfs.c index 76178cc06..87ff1f365 100644 --- a/os/hal/lib/complex/mfs/mfs.c +++ b/os/hal/lib/complex/mfs/mfs.c @@ -934,7 +934,7 @@ mfs_error_t mfsReadRecord(MFSDriver *mfsp, mfs_id_t id, }
/* Checking if the requested record actually exists.*/
- if (mfsp->descriptors[id - 1U].offset != 0U) {
+ if (mfsp->descriptors[id - 1U].offset == 0U) {
return MFS_ERR_NOT_FOUND;
}
@@ -943,6 +943,12 @@ mfs_error_t mfsReadRecord(MFSDriver *mfsp, mfs_id_t id, return MFS_ERR_INV_SIZE;
}
+ /* Header read from flash.*/
+ RET_ON_ERROR(mfs_flash_read(mfsp,
+ mfsp->descriptors[id - 1U].offset,
+ *np,
+ mfsp->buffer.data8));
+
/* Data read from flash.*/
*np = mfsp->descriptors[id - 1U].size;
RET_ON_ERROR(mfs_flash_read(mfsp,
|