Browse Source

ROMFS: add dshot startup support

sbg
Beat Küng 6 years ago
parent
commit
d8ef1b59b9
  1. 24
      ROMFS/px4fmu_common/init.d/rc.interface
  2. 2
      ROMFS/px4fmu_common/init.d/rcS

24
ROMFS/px4fmu_common/init.d/rc.interface

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
# Otherwise, the variable name goes to the end of the argument.
#
set FMU_CMD fmu
set MIXER_AUX_FILE none
set OUTPUT_AUX_DEV /dev/pwm_output1
set OUTPUT_DEV none
@ -42,10 +43,20 @@ then @@ -42,10 +43,20 @@ then
if [ $IO_PRESENT = yes ]
then
set OUTPUT_MODE io
if param greater DSHOT_CONFIG 0
then
set FMU_CMD dshot
fi
fi
else
if param greater DSHOT_CONFIG 0
then
set OUTPUT_MODE dshot
set FMU_CMD dshot
else
set OUTPUT_MODE fmu
fi
fi
fi
#
@ -80,11 +91,11 @@ then @@ -80,11 +91,11 @@ then
fi
fi
if [ $OUTPUT_MODE = fmu ]
if [ $OUTPUT_MODE = $FMU_CMD ]
then
if ! fmu mode_$FMU_MODE $FMU_ARGS
if ! $FMU_CMD mode_$FMU_MODE
then
echo "FMU start failed" >> $LOG_FILE
echo "$FMU_CMD start failed" >> $LOG_FILE
# Error tune.
tune_control play -t 2
fi
@ -195,7 +206,7 @@ then @@ -195,7 +206,7 @@ then
if [ $MIXER_AUX_FILE != none ]
then
if fmu mode_${AUX_MODE} $FMU_ARGS
if $FMU_CMD mode_${AUX_MODE}
then
# Append aux mixer to main device.
if param greater SYS_HITL 0
@ -228,6 +239,9 @@ then @@ -228,6 +239,9 @@ then
set FAILSAFE_AUX none
fi
# for DShot do not configure pwm values
if [ $FMU_CMD != dshot ]
then
# Set min / max for aux out and rates.
if [ $PWM_AUX_OUT != none ]
then
@ -305,6 +319,7 @@ then @@ -305,6 +319,7 @@ then
pwm failsafe -c 7 -p p:PWM_AUX_FAIL7 -d ${OUTPUT_AUX_DEV}
pwm failsafe -c 8 -p p:PWM_AUX_FAIL8 -d ${OUTPUT_AUX_DEV}
fi
fi
fi
if [ $OUTPUT_MODE = fmu -o $OUTPUT_MODE = io ]
@ -386,6 +401,7 @@ then @@ -386,6 +401,7 @@ then
pwm failsafe -c 8 -p p:PWM_MAIN_FAIL8
fi
unset FMU_CMD
unset MIXER_AUX_FILE
unset OUTPUT_AUX_DEV
unset OUTPUT_DEV

2
ROMFS/px4fmu_common/init.d/rcS

@ -27,7 +27,6 @@ set FAILSAFE none @@ -27,7 +27,6 @@ set FAILSAFE none
set FAILSAFE_AUX none
set FCONFIG /fs/microsd/etc/config.txt
set FEXTRAS /fs/microsd/etc/extras.txt
set FMU_ARGS ""
set FMU_MODE pwm
set FRC /fs/microsd/etc/rc.txt
set IOFW "/etc/extras/px4_io-v2_default.bin"
@ -521,7 +520,6 @@ unset FAILSAFE @@ -521,7 +520,6 @@ unset FAILSAFE
unset FAILSAFE_AUX
unset FCONFIG
unset FEXTRAS
unset FMU_ARGS
unset FMU_MODE
unset FRC
unset IO_PRESENT

Loading…
Cancel
Save