diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 17f00d9e24..043b9397cc 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -80,6 +80,15 @@ then set AUTOCNF no else set AUTOCNF yes + param set SYS_AUTOCONFIG 1 +fi + +if param compare SYS_AUTOCONFIG 1 +then + set AUTOCNF yes + + # Wipe out params except RC*, flight modes, total flight time, accel cal, gyro cal, next flight UUID + param reset_nostart RC* COM_FLTMODE* LND_FLIGHT_T_* TC_* CAL_ACC* CAL_GYRO* COM_FLIGHT_UUID fi # multi-instance setup @@ -202,6 +211,13 @@ fi sh "$autostart_file" +# +# If autoconfig parameter was set, reset it and save parameters. +# +if [ $AUTOCNF = yes ] +then + param set SYS_AUTOCONFIG 0 +fi dataman start replay tryapplyparams