diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-11-16 14:45:38 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-11-16 14:45:38 +0000 |
commit | 6ff9fd4af9df7d24d66f78ee7bba4088aaca4445 (patch) | |
tree | 47bd564477ce5d80ccfaf19e8bb1a6d35219ba2b /os/hal | |
parent | 266426242abce8c6306cfcc079b262a6d1089d19 (diff) | |
download | ChibiOS-6ff9fd4af9df7d24d66f78ee7bba4088aaca4445.tar.gz ChibiOS-6ff9fd4af9df7d24d66f78ee7bba4088aaca4445.tar.bz2 ChibiOS-6ff9fd4af9df7d24d66f78ee7bba4088aaca4445.zip |
Bug fixing.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11019 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-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,
|