rcS: add airframe parameter versioning and extend SYS_AUTOCONFIG

This commit is contained in:
Beat Küng
2019-04-05 08:08:47 +02:00
parent 46c4a68b62
commit 0bb5225370
2 changed files with 28 additions and 6 deletions
+23 -1
View File
@@ -57,6 +57,12 @@ set SDCARD_MIXERS_PATH /fs/microsd/etc/mixers
set USE_IO no
set VEHICLE_TYPE none
# Airframe parameter versioning: airframe maintainers can set this in the
# airframe startup script, and then increase it by one whenever an airframe
# parameter is updated - it will ensure that these parameters will be updated
# when the firmware is flashed.
set PARAM_DEFAULTS_VER 1
#
# Mount the procfs.
#
@@ -161,7 +167,12 @@ else
param reset_nostart RC* COM_FLTMODE* LND_FLIGHT_T_* TC_* CAL_ACC* CAL_GYRO*
set AUTOCNF yes
else
set AUTOCNF no
if param compare SYS_AUTOCONFIG 2
then
set AUTOCNF yes
else
set AUTOCNF no
fi
fi
#
@@ -473,6 +484,16 @@ else
#
sh /etc/init.d/rc.logging
if ! param compare SYS_PARAM_VER ${PARAM_DEFAULTS_VER}
then
echo "Switched to different parameter version. Resetting parameters."
param set SYS_PARAM_VER ${PARAM_DEFAULTS_VER}
param set SYS_AUTOCONFIG 2
param save
reboot
fi
#
# End of autostart.
#
@@ -503,6 +524,7 @@ unset MIXER_FILE
unset MK_MODE
unset MKBLCTRL_ARG
unset OUTPUT_MODE
unset PARAM_DEFAULTS_VER
unset PARAM_FILE
unset PWM_AUX_DISARMED
unset PWM_AUX_MAX