diff options
author | Anton Matosov <anton.matosov@gmail.com> | 2015-01-07 00:25:06 +0200 |
---|---|---|
committer | Anton Matosov <anton.matosov@gmail.com> | 2015-01-08 00:53:52 +0200 |
commit | 08062e6546f02cb2e819f690d35b485425788cc4 (patch) | |
tree | 34707300cb69fc63bb89bdc31e3feabad08a84d1 /ROMFS/px4fmu_common/init.d/rc.interface | |
parent | 74b63d08e1f2dd34b2c18be9d46d0837a9be5b9f (diff) | |
download | px4-firmware-08062e6546f02cb2e819f690d35b485425788cc4.tar.gz px4-firmware-08062e6546f02cb2e819f690d35b485425788cc4.tar.bz2 px4-firmware-08062e6546f02cb2e819f690d35b485425788cc4.zip |
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
Diffstat (limited to 'ROMFS/px4fmu_common/init.d/rc.interface')
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.interface | 58 |
1 files changed, 43 insertions, 15 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rc.interface b/ROMFS/px4fmu_common/init.d/rc.interface index 98f41b31e..d4880ea42 100644 --- a/ROMFS/px4fmu_common/init.d/rc.interface +++ b/ROMFS/px4fmu_common/init.d/rc.interface @@ -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 |