mirror of
https://github.com/synthetos/g2.git
synced 2026-02-05 18:49:54 +08:00
Cleanup when to persist
This commit is contained in:
@@ -140,9 +140,9 @@ static void _set_defa(nvObj_t *nv, bool print)
|
||||
}
|
||||
strncpy(nv->token, cfgArray[nv->index].token, TOKEN_LEN);
|
||||
cfgArray[nv->index].set(nv); // run the set method, nv_set(nv);
|
||||
if (cfgArray[nv->index].flags & F_PERSIST) {
|
||||
nv_persist(nv);
|
||||
}
|
||||
// if (cfgArray[nv->index].flags & F_PERSIST) {
|
||||
// nv_persist(nv);
|
||||
// }
|
||||
}
|
||||
}
|
||||
sr_init_status_report(); // reset status reports
|
||||
|
||||
@@ -130,9 +130,9 @@ stat_t read_persistent_value(nvObj_t *nv)
|
||||
|
||||
stat_t write_persistent_value(nvObj_t *nv)
|
||||
{
|
||||
if (read_persistent_value(nv) != STAT_OK) {
|
||||
// if (read_persistent_value(nv) != STAT_OK) {
|
||||
nvm.changed_nv_indexes[nvm.changed_nvs++] = nv->index;
|
||||
}
|
||||
// }
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ void sr_init_status_report()
|
||||
return;
|
||||
}
|
||||
nv_set(nv);
|
||||
nv_persist(nv); // conditionally persist - automatic by nv_persist()
|
||||
// nv_persist(nv); // conditionally persist - automatic by nv_persist()
|
||||
nv->index++; // increment SR NVM index
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user