Skip to content

Commit

Permalink
Clarify comments about parameter versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR committed Jun 11, 2024
1 parent 8f1a79f commit ca6cd87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ set SDCARD_FORMAT no
set STARTUP_TUNE 1
set VEHICLE_TYPE none

# Airframe parameter versioning: airframe maintainers can optionally set this in the
# airframe startup script, and then increase it by one whenever they want to ensure
# that parameters are reset to the airframe defaults for an update.
# Airframe parameter versioning
# Value set to 1 by default but can optionally be overridden in the airframe configuration startup script.
# Airframe maintainers can ensure a reset to the airframe defaults during an update by increasing by one.
# e.g. add line "set PARAM_DEFAULTS_VER 2" in your airframe file to build the first update that enfoces a reset.
set PARAM_DEFAULTS_VER 1

#
Expand Down Expand Up @@ -236,8 +237,8 @@ else
fi
unset AUTOSTART_PATH

# Check parameter version and reset upon airframe configuration version mismatch
# reboot required because "param reset_all" would reset all "param set" lines from airframe
# 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}
then
echo "Switched to different parameter version. Resetting parameters."
Expand Down
4 changes: 2 additions & 2 deletions src/lib/systemlib/system_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ PARAM_DEFINE_INT32(SYS_HITL, 0);
*
* This is used internally only: an airframe configuration might set an expected
* parameter version value via PARAM_DEFAULTS_VER. This is checked on bootup
* against SYS_PARAM_VER, and if they do not match, parameters from the airframe
* configuration are reloaded.
* against SYS_PARAM_VER, and if they do not match, parameters are reset and
* reloaded from the airframe configuration.
*
* @min 0
* @group System
Expand Down

0 comments on commit ca6cd87

Please sign in to comment.