pwm_out, dshot: remove mode_* handling and capture ioctl's

They now use all unused pins, whereas camera_capture, camera_trigger and
pwm_input modules start before to reserve their pins.
This commit is contained in:
Beat Küng
2021-09-08 16:10:24 -04:00
committed by Daniel Agar
parent 062dd28f4d
commit 1ee423e3c8
10 changed files with 71 additions and 2263 deletions
+25 -69
View File
@@ -29,12 +29,6 @@ then
fi
fi
# USE_IO is set to 'no' for all boards w/o px4io driver or SYS_USE_IO disabled
if [ $USE_IO = no -a $AUX_BANK2 = none ]
then
set AUX_MODE none
fi
#
# Set the default output mode if none was set.
#
@@ -76,15 +70,6 @@ then
fi
fi
if [ $OUTPUT_MODE = $OUTPUT_CMD ]
then
if ! $OUTPUT_CMD mode_$FMU_MODE
then
echo "$OUTPUT_CMD start failed"
tune_control play error
fi
fi
if [ $OUTPUT_MODE = uavcan_esc ]
then
if param compare UAVCAN_ENABLE 0
@@ -98,6 +83,15 @@ then
. ${R}etc/init.d/rc.io
fi
if [ $OUTPUT_MODE = $OUTPUT_CMD -o $OUTPUT_MODE = io ]
then
if ! $OUTPUT_CMD start
then
echo "$OUTPUT_CMD start failed"
tune_control play error
fi
fi
#
# Start IO for RC input if needed.
#
@@ -161,7 +155,7 @@ else
fi
fi
if [ $MIXER_AUX != none -a $AUX_MODE != none ]
if [ $MIXER_AUX != none ]
then
#
# Load aux mixer.
@@ -179,34 +173,26 @@ then
if [ $MIXER_AUX_FILE != none ]
then
# Start the output module
if $OUTPUT_CMD mode_${AUX_MODE}
# Append aux mixer to main device.
if param greater SYS_HITL 0
then
# Append aux mixer to main device.
if param greater SYS_HITL 0
if mixer append ${OUTPUT_DEV} ${MIXER_AUX_FILE}
then
if mixer append ${OUTPUT_DEV} ${MIXER_AUX_FILE}
then
echo "INFO [init] Mixer: ${MIXER_AUX_FILE} appended to ${OUTPUT_DEV}"
else
echo "ERROR [init] Failed appending mixer: ${MIXER_AUX_FILE}"
fi
fi
if [ -e $OUTPUT_AUX_DEV -a $OUTPUT_MODE != hil ]
then
if mixer load ${OUTPUT_AUX_DEV} ${MIXER_AUX_FILE}
then
echo "INFO [init] Mixer: ${MIXER_AUX_FILE} on ${OUTPUT_AUX_DEV}"
else
echo "ERROR [init] Failed loading mixer: ${MIXER_AUX_FILE}"
fi
echo "INFO [init] Mixer: ${MIXER_AUX_FILE} appended to ${OUTPUT_DEV}"
else
echo "INFO [init] setting PWM_AUX_OUT none"
set PWM_AUX_OUT none
echo "ERROR [init] Failed appending mixer: ${MIXER_AUX_FILE}"
fi
fi
if [ -e $OUTPUT_AUX_DEV -a $OUTPUT_MODE != hil ]
then
if mixer load ${OUTPUT_AUX_DEV} ${MIXER_AUX_FILE}
then
echo "INFO [init] Mixer: ${MIXER_AUX_FILE} on ${OUTPUT_AUX_DEV}"
else
echo "ERROR [init] Failed loading mixer: ${MIXER_AUX_FILE}"
fi
else
echo "ERROR: Could not start: pwm_out mode_pwm"
tune_control play -t 18 # tune 18 = PROG_PX4IO_ERR
echo "INFO [init] setting PWM_AUX_OUT none"
set PWM_AUX_OUT none
fi
@@ -228,36 +214,6 @@ fi
param set PWM_AUX_OUT ${PWM_AUX_OUT}
if [ $MIXER_AUX != none -a $AUX_MODE = none -a -e $OUTPUT_AUX_DEV ]
then
#
# Load aux mixer.
#
if [ -f ${SDCARD_MIXERS_PATH}/${MIXER_AUX}.aux.mix ]
then
set MIXER_AUX_FILE ${SDCARD_MIXERS_PATH}/${MIXER_AUX}.aux.mix
else
if [ -f /etc/mixers/${MIXER_AUX}.aux.mix ]
then
set MIXER_AUX_FILE /etc/mixers/${MIXER_AUX}.aux.mix
fi
fi
if mixer load ${OUTPUT_AUX_DEV} ${MIXER_AUX_FILE}
then
echo "INFO [init] Mixer: ${MIXER_AUX_FILE} on ${OUTPUT_AUX_DEV}"
# 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
else
echo "ERROR [init] Failed loading mixer: ${MIXER_AUX_FILE}"
fi
fi
if [ $OUTPUT_MODE = pwm_out -o $OUTPUT_MODE = io ]
then
if [ $PWM_OUT != none ]