Commit 08062e65 authored by Anton Matosov's avatar Anton Matosov
Browse files

Changed naming of the mixers to get rid of umbiguity as outputs are actually...

Changed naming of the mixers to get rid of umbiguity as outputs are actually going to be driven by io, not fmu
Implemented automatic lookup for the .aux.mix file if it exists
parent 74b63d08
......@@ -7,6 +7,6 @@
sh /etc/init.d/rc.mc_defaults
set MIXER FMU_quad_+
set MIXER quad_+
set PWM_OUT 1234
......@@ -7,7 +7,7 @@
sh /etc/init.d/rc.mc_defaults
set MIXER FMU_hexa_x
set MIXER hexa_x
# Need to set all 8 channels
set PWM_OUT 12345678
......@@ -7,7 +7,7 @@
sh /etc/init.d/rc.mc_defaults
set MIXER FMU_hexa_+
set MIXER hexa_+
# Need to set all 8 channels
set PWM_OUT 12345678
......@@ -7,6 +7,6 @@
sh /etc/init.d/rc.mc_defaults
set MIXER FMU_octo_x
set MIXER octo_x
set PWM_OUT 12345678
......@@ -7,6 +7,6 @@
sh /etc/init.d/rc.mc_defaults
set MIXER FMU_octo_+
set MIXER octo_+
set PWM_OUT 12345678
......@@ -3,19 +3,30 @@
# Script to configure control interface
#
set SDCARD_MIXERS_PATH /fs/microsd/etc/mixers
if [ $MIXER != none -a $MIXER != skip ]
then
#
# Load mixer
# Load main mixer
#
if [ $MIXER_AUX == none ]
then
MIXER_AUX = $MIXER.aux
fi
# Use the mixer file from the SD-card if it exists
if [ -f /fs/microsd/etc/mixers/$MIXER.mix ]
if [ -f $SDCARD_MIXERS_PATH/$MIXER.main.mix ]
then
set MIXER_FILE /fs/microsd/etc/mixers/$MIXER.mix
else
set MIXER_FILE /etc/mixers/$MIXER.mix
fi
set MIXER_FILE $SDCARD_MIXERS_PATH/$MIXER.main.mix
# Try out the old convention, for backward compatibility
elif [ -f $SDCARD_MIXERS_PATH/$MIXER.mix ]
then
set MIXER_FILE $SDCARD_MIXERS_PATH/$MIXER.mix
else
set MIXER_FILE /etc/mixers/$MIXER.main.mix
fi
if [ $OUTPUT_MODE == mkblctrl ]
then
......@@ -80,14 +91,31 @@ then
pwm failsafe -d $OUTPUT_DEV $FAILSAFE
fi
fi
# check if should load secondary mixer
if [ $MIXER_SEC != none ]
if [ $MIXER_AUX != none ]
then
if fmu mode_pwm
then
mixer load /dev/pwm_output1 /etc/mixers/$MIXER_SEC.mix
else
tone_alarm $TUNE_ERR
fi
fi
#
# Load aux mixer
#
set MIXER_AUX_FILE none
if [ -f $SDCARD_MIXERS_PATH/$MIXER_AUX.mix ]
then
set MIXER_AUX_FILE $SDCARD_MIXERS_PATH/$MIXER_AUX.mix
elif [ -f /etc/mixers/$MIXER_AUX.mix ]
then
set MIXER_AUX_FILE /etc/mixers/$MIXER_AUX.mix
fi
if [ $MIXER_AUX_FILE != none -a $FMU_MODE == pwm ]
then
if fmu mode_pwm
then
mixer load /dev/pwm_output1 $MIXER_AUX_FILE
else
tone_alarm $TUNE_ERR
fi
fi
fi
\ No newline at end of file
......@@ -116,7 +116,7 @@ then
set HIL no
set VEHICLE_TYPE none
set MIXER none
set MIXER_SEC none
set MIXER_AUX none
set OUTPUT_MODE none
set PWM_OUT none
set PWM_RATE none
......@@ -482,7 +482,7 @@ then
if [ $MIXER == none ]
then
# Set default mixer for fixed wing if not defined
set MIXER FMU_AERT
set MIXER AERT
fi
if [ $MAV_TYPE == none ]
......@@ -518,27 +518,27 @@ then
if [ $MAV_TYPE == none ]
then
# Use mixer to detect vehicle type
if [ $MIXER == FMU_quad_x -o $MIXER == FMU_quad_+ ]
if [ $MIXER == quad_x -o $MIXER == quad_+ ]
then
set MAV_TYPE 2
fi
if [ $MIXER == FMU_quad_w ]
if [ $MIXER == quad_w ]
then
set MAV_TYPE 2
fi
if [ $MIXER == FMU_hexa_x -o $MIXER == FMU_hexa_+ ]
if [ $MIXER == hexa_x -o $MIXER == hexa_+ ]
then
set MAV_TYPE 13
fi
if [ $MIXER == FMU_hexa_cox ]
if [ $MIXER == hexa_cox ]
then
set MAV_TYPE 13
fi
if [ $MIXER == FMU_octo_x -o $MIXER == FMU_octo_+ ]
if [ $MIXER == octo_x -o $MIXER == octo_+ ]
then
set MAV_TYPE 14
fi
if [ $MIXER == FMU_octo_cox ]
if [ $MIXER == octo_cox ]
then
set MAV_TYPE 14
fi
......@@ -577,11 +577,11 @@ then
if [ $MAV_TYPE == none ]
then
# Use mixer to detect vehicle type
if [ $MIXER == FMU_caipirinha_vtol ]
if [ $MIXER == caipirinha_vtol ]
then
set MAV_TYPE 19
fi
if [ $MIXER == FMU_firefly6_rotors ]
if [ $MIXER == firefly6_rotors ]
then
set MAV_TYPE 21
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment