Skip to content

Commit

Permalink
rc.interface: allow setting a custom MIXER_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
bkueng authored and dagar committed Aug 14, 2018
1 parent e6b9806 commit 5ebd011
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 11 additions & 9 deletions ROMFS/px4fmu_common/init.d/rc.interface
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -168,7 +171,6 @@ then
tone_alarm ${TUNE_ERR}
fi

unset MIXER_FILE
else
if [ $MIXER != skip ]
then
Expand Down
2 changes: 2 additions & 0 deletions ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5ebd011

Please sign in to comment.