Skip to content

Commit

Permalink
rcS: reduce a few LOC in AUTOCNF logic (#12467)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
mcsauder authored and bkueng committed Jul 16, 2019
1 parent e6aa035 commit 4a02475
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

#
Expand Down

0 comments on commit 4a02475

Please sign in to comment.