Made aux output pwm rate, min, max, disarmed and failsafe values configurable the same way as for the main outputs

This commit is contained in:
Anton Matosov 2015-03-03 23:53:48 -08:00
parent 7bf6c3bae8
commit e191958ce6
3 changed files with 45 additions and 1 deletions

View File

@ -30,4 +30,9 @@ set MIXER sk450_deadcat
set PWM_OUT 1234
set PWM_MIN 1050
set PWM_AUX_OUT 1234
# set PWM_AUX_MIN 900
# set PWM_AUX_MAX 2100
set PWM_AUX_RATE 100
gimbal start

View File

@ -103,6 +103,7 @@ then
#
set MIXER_AUX_FILE none
set OUTPUT_AUX_DEV /dev/pwm_output1
if [ -f $SDCARD_MIXERS_PATH/$MIXER_AUX.mix ]
then
@ -119,10 +120,43 @@ then
then
if fmu mode_pwm
then
mixer load /dev/pwm_output1 $MIXER_AUX_FILE
mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE
else
tone_alarm $TUNE_ERR
fi
if [ $PWM_AUX_OUT != none ]
then
#
# Set PWM_AUX output frequency
#
if [ $PWM_AUX_RATE != none ]
then
pwm rate -c $PWM_AUX_OUT -r $PWM_AUX_RATE -d $OUTPUT_AUX_DEV
fi
#
# Set disarmed, min and max PWM_AUX values
#
if [ $PWM_AUX_DISARMED != none ]
then
pwm disarmed -c $PWM_AUX_OUT -p $PWM_AUX_DISARMED -d $OUTPUT_AUX_DEV
fi
if [ $PWM_AUX_MIN != none ]
then
pwm min -c $PWM_AUX_OUT -p $PWM_AUX_MIN -d $OUTPUT_AUX_DEV
fi
if [ $PWM_AUX_MAX != none ]
then
pwm max -c $PWM_AUX_OUT -p $PWM_AUX_MAX -d $OUTPUT_AUX_DEV
fi
fi
if [ $FAILSAFE_AUX != none ]
then
pwm failsafe -d $OUTPUT_AUX_DEV $FAILSAFE
fi
fi
fi
unset OUTPUT_DEV

View File

@ -109,6 +109,11 @@ then
set PWM_DISARMED none
set PWM_MIN none
set PWM_MAX none
set PWM_AUX_OUT none
set PWM_AUX_RATE none
set PWM_AUX_DISARMED none
set PWM_AUX_MIN none
set PWM_AUX_MAX none
set MK_MODE none
set FMU_MODE pwm
set MAVLINK_F default