Startup: don't configure anything if definitions are missing

This commit is contained in:
Julian Oes 2014-02-10 15:12:32 +01:00
parent aea135a9ce
commit 36d1ec80ef
1 changed files with 18 additions and 10 deletions

View File

@ -464,16 +464,20 @@ then
if [ $MIXER == none ]
then
# Set default mixer for multicopter if not defined
set MIXER quad_x
echo "Default mixer for multicopter not defined"
fi
if [ $MAV_TYPE == none ]
then
# Use MAV_TYPE = 2 (quadcopter) if not defined
set MAV_TYPE 2
# Use mixer to detect vehicle type
if [ $MIXER == FMU_quad_x -o $MIXER == FMU_quad_+ ]
then
set MAV_TYPE 2
fi
if [ $MIXER == FMU_quad_w ]
then
set MAV_TYPE 2
fi
if [ $MIXER == FMU_hexa_x -o $MIXER == FMU_hexa_+ ]
then
set MAV_TYPE 13
@ -487,8 +491,14 @@ then
set MAV_TYPE 14
fi
fi
param set MAV_TYPE $MAV_TYPE
# Still no MAV_TYPE found
if [ $MAV_TYPE == none ]
then
echo "Unknown MAV_TYPE"
else
param set MAV_TYPE $MAV_TYPE
fi
# Load mixer and configure outputs
sh /etc/init.d/rc.interface
@ -502,10 +512,8 @@ then
#
if [ $VEHICLE_TYPE == none ]
then
echo "[init] Vehicle type: GENERIC"
echo "[init] Vehicle type: No autostart ID found"
# Load mixer and configure outputs
sh /etc/init.d/rc.interface
fi
# Start any custom addons