rc.interface: allow setting a custom MIXER_FILE

This commit is contained in:
Beat Küng 2018-08-11 17:59:24 +02:00 committed by Daniel Agar
parent e6b9806ee1
commit 5ebd0116de
2 changed files with 13 additions and 9 deletions

View File

@ -128,17 +128,20 @@ then
set MIXER_AUX ${MIXER}
fi
if [ -f ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix ]
if [ "$MIXER_FILE" == none ]
then
# Use the mixer file from the SD-card if it exists.
set MIXER_FILE ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix
else
# Try out the old convention, for backward compatibility.
if [ -f ${SDCARD_MIXERS_PATH}/${MIXER}.mix ]
if [ -f ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix ]
then
set MIXER_FILE ${SDCARD_MIXERS_PATH}/${MIXER}.mix
# Use the mixer file from the SD-card if it exists.
set MIXER_FILE ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix
else
set MIXER_FILE /etc/mixers/${MIXER}.main.mix
# Try out the old convention, for backward compatibility.
if [ -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
fi
fi
@ -168,7 +171,6 @@ then
tone_alarm ${TUNE_ERR}
fi
unset MIXER_FILE
else
if [ $MIXER != skip ]
then

View File

@ -65,6 +65,7 @@ set MAVLINK_COMPANION_DEVICE /dev/ttyS2
set MAV_TYPE none
set MIXER none
set MIXER_AUX none
set MIXER_FILE none
set MK_MODE none
set MKBLCTRL_ARG ""
set OUTPUT_MODE none
@ -546,6 +547,7 @@ unset MAVLINK_COMPANION_DEVICE
unset MAV_TYPE
unset MIXER
unset MIXER_AUX
unset MIXER_FILE
unset MK_MODE
unset MKBLCTRL_ARG
unset OUTPUT_DEV