From 4a02475dd183721701536fbcb4a4229d55911006 Mon Sep 17 00:00:00 2001 From: Mark Sauder Date: Tue, 16 Jul 2019 08:48:25 -0600 Subject: [PATCH] rcS: reduce a few LOC in AUTOCNF logic (#12467) * Set/unset rcS vars at beginning and end of rcS script and reduce a few LOC checking SYS_AUTOCONFIG with improved logic. * Restore current placement of set/unset vars in rcS script to leave only the SYS_AUTOCONFIG logic modification. * Replace set AUTOCNF no after inadvertent deletion. --- ROMFS/px4fmu_common/init.d/rcS | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 254ce49cc1..f393e4d18f 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -20,6 +20,7 @@ set +e # Do not add intra word spaces # it wastes flash # +set AUTOCNF no set AUX_MODE pwm set DATAMAN_OPT "" set FAILSAFE none @@ -148,18 +149,15 @@ else # # Set AUTOCNF flag to use it in AUTOSTART scripts. # - if param compare SYS_AUTOCONFIG 1 + if param greater SYS_AUTOCONFIG 0 then - # Wipe out params except RC*, flight modes, total flight time, accel cal, gyro cal - param reset_nostart RC* COM_FLTMODE* LND_FLIGHT_T_* TC_* CAL_ACC* CAL_GYRO* - set AUTOCNF yes - else - if param compare SYS_AUTOCONFIG 2 + if param compare SYS_AUTOCONFIG 1 then - set AUTOCNF yes - else - set AUTOCNF no + # Wipe out params except RC*, flight modes, total flight time, accel cal, gyro cal + param reset_nostart RC* COM_FLTMODE* LND_FLIGHT_T_* TC_* CAL_ACC* CAL_GYRO* fi + + set AUTOCNF yes fi #