mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-20 20:03:54 +08:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user