fix(parameters): save resets synchronously and scope caldata repair (#27658)

* fix(commander): save parameters synchronously after parameter reset

ParamResetAll and ParamResetAllConfig relied on the deferred autosave (300 ms delay, 2 s rate limit) to persist the reset, so a reboot or power cycle right after the command ack could leave the old parameters in storage. Save synchronously like ParamResetSensorFactory already does.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(rcS): only run caldata BSON size repair on boards with caldata

The bsondump docsize block from #23088 repairs a zeroed BSON document size field in /fs/mtd_caldata, but it ran unconditionally with a comment claiming it checks /fs/mtd_params, producing failed-bsondump boot noise on every board without a caldata partition. Move it inside the MTD_CALDATA gate next to the param load it exists to protect.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
This commit is contained in:
Jacob Dahl authored and GitHub committed 2026-06-14 16:24:09 -06:00
1 parent 183b3e38d5
commit a5b2270292
2 files changed
+9 -9

No files matched your search

+2 -2
View File
@@ -176,7 +176,7 @@ void WorkerThread::threadEntry()
case Request::ParamResetAll:
param_reset_all();
_ret_value = 0;
_ret_value = param_save_default(true);
break;
case Request::ParamResetSensorFactory: {
@@ -196,7 +196,7 @@ void WorkerThread::threadEntry()
"COM_FLIGHT_UUID"
};
param_reset_excludes(exclude_list, sizeof(exclude_list) / sizeof(exclude_list[0]));
_ret_value = 0;
_ret_value = param_save_default(true);
break;
}
}