diff options
author | Anton Matosov <anton.matosov@gmail.com> | 2015-03-03 23:53:48 -0800 |
---|---|---|
committer | Anton Matosov <anton.matosov@gmail.com> | 2015-03-06 18:57:38 -0800 |
commit | e191958ce656dbc31bc0029b9d0e1ed2fd4db72c (patch) | |
tree | 165a3e2327d1360657b54cac470cb915186f3bbd /ROMFS/px4fmu_common/init.d/rc.interface | |
parent | 7bf6c3bae867e3ed350043a89e7e1ad4b87b9236 (diff) | |
download | px4-firmware-e191958ce656dbc31bc0029b9d0e1ed2fd4db72c.tar.gz px4-firmware-e191958ce656dbc31bc0029b9d0e1ed2fd4db72c.tar.bz2 px4-firmware-e191958ce656dbc31bc0029b9d0e1ed2fd4db72c.zip |
Made aux output pwm rate, min, max, disarmed and failsafe values configurable the same way as for the main outputs
Diffstat (limited to 'ROMFS/px4fmu_common/init.d/rc.interface')
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.interface | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rc.interface b/ROMFS/px4fmu_common/init.d/rc.interface index 767a4564e..5101acc07 100644 --- a/ROMFS/px4fmu_common/init.d/rc.interface +++ b/ROMFS/px4fmu_common/init.d/rc.interface @@ -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 |