mirror of
https://github.com/armink/FlashDB.git
synced 2025-01-29 04:32:53 +08:00
[tsdb&kvdb] improve the control function.
This commit is contained in:
parent
145991e6eb
commit
074bdee64f
@ -1531,6 +1531,8 @@ void fdb_kvdb_control(fdb_kvdb_t db, int cmd, void *arg)
|
|||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case FDB_KVDB_CTRL_SET_SEC_SIZE:
|
case FDB_KVDB_CTRL_SET_SEC_SIZE:
|
||||||
|
/* the sector size change MUST before database initialization */
|
||||||
|
FDB_ASSERT(db->parent.init_ok == false);
|
||||||
db->parent.sec_size = *(uint32_t *)arg;
|
db->parent.sec_size = *(uint32_t *)arg;
|
||||||
break;
|
break;
|
||||||
case FDB_KVDB_CTRL_GET_SEC_SIZE:
|
case FDB_KVDB_CTRL_GET_SEC_SIZE:
|
||||||
|
@ -675,6 +675,8 @@ void fdb_tsdb_control(fdb_tsdb_t db, int cmd, void *arg)
|
|||||||
*(bool *)arg = db->rollover;
|
*(bool *)arg = db->rollover;
|
||||||
break;
|
break;
|
||||||
case FDB_TSDB_CTRL_SET_SEC_SIZE:
|
case FDB_TSDB_CTRL_SET_SEC_SIZE:
|
||||||
|
/* the sector size change MUST before database initialization */
|
||||||
|
FDB_ASSERT(db->parent.init_ok == false);
|
||||||
db->parent.sec_size = *(uint32_t *)arg;
|
db->parent.sec_size = *(uint32_t *)arg;
|
||||||
break;
|
break;
|
||||||
case FDB_TSDB_CTRL_GET_SEC_SIZE:
|
case FDB_TSDB_CTRL_GET_SEC_SIZE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user