Bug fixing.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11019 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2017-11-16 14:45:38 +00:00
parent 266426242a
commit 6ff9fd4af9
2 changed files with 8 additions and 2 deletions

View File

@ -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,

View File

@ -42,7 +42,7 @@ const M25QConfig m25qcfg1 = {
const MFSConfig mfscfg1 = {
(BaseFlash *)&m25q,
0xFFFFFFFFU,
131072U,
4096U,
0,
2,
2,