diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-11-16 14:23:28 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-11-16 14:23:28 +0000 |
commit | d7ce59dc3cb5f1ea14807320ca7031f1e17e8f37 (patch) | |
tree | d867972d5ed03e7fb29c47a94b9e67c97c5b0835 /os/hal/lib/complex/mfs/mfs.c | |
parent | 7037d2fa6cb8326a05852bf22062257dba0c5a48 (diff) | |
download | ChibiOS-d7ce59dc3cb5f1ea14807320ca7031f1e17e8f37.tar.gz ChibiOS-d7ce59dc3cb5f1ea14807320ca7031f1e17e8f37.tar.bz2 ChibiOS-d7ce59dc3cb5f1ea14807320ca7031f1e17e8f37.zip |
First MFS test sequence complete, starting debug.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11017 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/lib/complex/mfs/mfs.c')
-rw-r--r-- | os/hal/lib/complex/mfs/mfs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/os/hal/lib/complex/mfs/mfs.c b/os/hal/lib/complex/mfs/mfs.c index 77ae33128..76178cc06 100644 --- a/os/hal/lib/complex/mfs/mfs.c +++ b/os/hal/lib/complex/mfs/mfs.c @@ -921,11 +921,12 @@ mfs_error_t mfsErase(MFSDriver *mfsp) { *
* @api
*/
-mfs_error_t mfsReadRecord(MFSDriver *mfsp, uint32_t id,
+mfs_error_t mfsReadRecord(MFSDriver *mfsp, mfs_id_t id,
size_t *np, uint8_t *buffer) {
uint16_t crc;
- osalDbgCheck((mfsp != NULL) && (id >= 1) && (id <= MFS_CFG_MAX_RECORDS) &&
+ osalDbgCheck((mfsp != NULL) &&
+ (id >= 1) && (id <= (mfs_id_t)MFS_CFG_MAX_RECORDS) &&
(np != NULL) && (buffer != NULL));
if (mfsp->state != MFS_READY) {
@@ -978,12 +979,13 @@ mfs_error_t mfsReadRecord(MFSDriver *mfsp, uint32_t id, *
* @api
*/
-mfs_error_t mfsWriteRecord(MFSDriver *mfsp, uint32_t id,
+mfs_error_t mfsWriteRecord(MFSDriver *mfsp, mfs_id_t id,
size_t n, const uint8_t *buffer) {
flash_offset_t free, required;
bool warning = false;
- osalDbgCheck((mfsp != NULL) && (id >= 1) && (id <= MFS_CFG_MAX_RECORDS) &&
+ osalDbgCheck((mfsp != NULL) &&
+ (id >= 1) && (id <= (mfs_id_t)MFS_CFG_MAX_RECORDS) &&
(n > 0U) && (buffer != NULL));
if (mfsp->state != MFS_READY) {
@@ -1064,11 +1066,12 @@ mfs_error_t mfsWriteRecord(MFSDriver *mfsp, uint32_t id, *
* @api
*/
-mfs_error_t mfsEraseRecord(MFSDriver *mfsp, uint32_t id) {
+mfs_error_t mfsEraseRecord(MFSDriver *mfsp, mfs_id_t id) {
flash_offset_t free, required;
bool warning = false;
- osalDbgCheck((mfsp != NULL) && (id >= 1) && (id <= MFS_CFG_MAX_RECORDS));
+ osalDbgCheck((mfsp != NULL) &&
+ (id >= 1U) && (id <= (mfs_id_t)MFS_CFG_MAX_RECORDS));
if (mfsp->state != MFS_READY) {
return MFS_ERR_INV_STATE;
|