feat(reboot): new param to not exlcude CAL_* params on a param reset (#28110)

* feat(reboot): new param to reset also CAL_* params with reboot and SYS_AUTOCONFIG on

* refactor(reboot): SYS_AUTOCFG_CAL description shorter

* refactor(reboot): reset SYS_AUTOCFG_CAL

* refactor(reboot): swap lines to make SYS_AUTOCFG_CAL appear in params list even if not set default to anything
This commit is contained in:
elisaaferraraa
2026-08-05 15:56:42 +02:00
committed by GitHub
parent 6388739efb
commit e308d6105d
2 changed files with 21 additions and 1 deletions
+13 -1
View File
@@ -253,10 +253,12 @@ else
fi
# To trigger a parameter reset during boot SYS_AUTOCONFIG was set to 1 before
set PARAM_RESET_DONE no
if param greater SYS_AUTOCONFIG 0
then
# Reset parameters except airframe, parameter version, sensor calibration, total flight time, flight UUID
param reset_all SYS_AUTOSTART SYS_PARAM_VER CAL_* LND_FLIGHT* TC_* COM_FLIGHT*
param reset_all SYS_AUTOSTART SYS_PARAM_VER SYS_AUTOCFG_CAL CAL_* LND_FLIGHT* TC_* COM_FLIGHT*
set PARAM_RESET_DONE yes
fi
#
@@ -314,6 +316,15 @@ else
tune_control play error
fi
# Calibration defaults
if param greater SYS_AUTOCFG_CAL 0
then
if [ ${PARAM_RESET_DONE} = yes ]
then
param reset CAL_* SYS_AUTOCFG_CAL
fi
fi
# Check parameter version and reset upon airframe configuration version mismatch.
# Reboot required because "param reset_all" would reset all "param set" lines from airframe.
if ! param compare SYS_PARAM_VER ${PARAM_DEFAULTS_VER}
@@ -765,6 +776,7 @@ unset LOGGER_BUF
unset PARAM_FILE
unset PARAM_BACKUP_FILE
unset PARAM_DEFAULTS_VER
unset PARAM_RESET_DONE
unset RC_INPUT_ARGS
unset STORAGE_AVAILABLE
unset STORAGE_CHECK
+8
View File
@@ -24,6 +24,14 @@ parameters:
0: Keep parameters
1: Reset parameters to airframe defaults
default: 0
SYS_AUTOCFG_CAL:
description:
short: Sensor calibration in SYS_AUTOCONFIG reset
long: |-
If enabled, a SYS_AUTOCONFIG reset overwrites stored sensor calibration with the airframe's built-in defaults.
Enable when the airframe ships its own calibration.
type: boolean
default: 0
SYS_HITL:
description:
short: Enable HITL/SIH mode on next boot