Skip to content

Commit a8e8dca

Browse files
[fdb_utils][_fdb_flash_write]: fix returned incorrect error code. (#300)
If user has set file mode, but file mode is disabled, _fdb_flash_write should return FDB_WRITE_ERR, not FDB_READ_ERR.
1 parent 8f80336 commit a8e8dca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fdb_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ fdb_err_t _fdb_flash_write(fdb_db_t db, uint32_t addr, const void *buf, size_t s
304304
#ifdef FDB_USING_FILE_MODE
305305
return _fdb_file_write(db, addr, buf, size, sync);
306306
#else
307-
return FDB_READ_ERR;
307+
return FDB_WRITE_ERR;
308308
#endif /* FDB_USING_FILE_MODE */
309309
} else {
310310
#ifdef FDB_USING_FAL_MODE

0 commit comments

Comments
 (0)