mirror of
https://github.com/armink/FlashDB.git
synced 2026-08-18 09:28:01 +08:00
[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.
This commit is contained in:
+1
-1
@@ -304,7 +304,7 @@ fdb_err_t _fdb_flash_write(fdb_db_t db, uint32_t addr, const void *buf, size_t s
|
||||
#ifdef FDB_USING_FILE_MODE
|
||||
return _fdb_file_write(db, addr, buf, size, sync);
|
||||
#else
|
||||
return FDB_READ_ERR;
|
||||
return FDB_WRITE_ERR;
|
||||
#endif /* FDB_USING_FILE_MODE */
|
||||
} else {
|
||||
#ifdef FDB_USING_FAL_MODE
|
||||
|
||||
Reference in New Issue
Block a user