Migrate px4io logic into rc.io.

This commit is contained in:
mcsauder
2018-07-19 02:41:02 -06:00
committed by Beat Küng
parent bccda56ed3
commit 4f937a2ff6
2 changed files with 27 additions and 40 deletions

View File

@@ -1,17 +1,16 @@
#!nsh
#
# Init PX4IO interface
# PX4IO interface init script.
#
#
# Allow PX4IO to recover from midair restarts.
#
px4io recovery
#
# Adjust PX4IO update rate limit
#
set PX4IO_LIMIT 400
if px4io limit ${PX4IO_LIMIT}
if px4io start
then
# Allow PX4IO to recover from midair restarts.
px4io recovery
# Adjust PX4IO update rate limit.
px4io limit 400
else
echo "PX4IO start failed" >> $LOG_FILE
tune_control play -m ${TUNE_ERR}
fi

View File

@@ -470,27 +470,6 @@ else
fi
fi
if [ $OUTPUT_MODE == io -o $OUTPUT_MODE == uavcan_esc ]
then
if px4io start
then
sh /etc/init.d/rc.io
else
echo "PX4IO start failed" >> $LOG_FILE
tune_control play -m ${TUNE_ERR}
fi
fi
if [ $OUTPUT_MODE == fmu ]
then
if fmu mode_$FMU_MODE $FMU_ARGS
then
else
echo "FMU start failed" >> $LOG_FILE
tune_control play -m ${TUNE_ERR}
fi
fi
if [ $OUTPUT_MODE == mkblctrl ]
then
if [ $MKBLCTRL_MODE == x ]
@@ -523,6 +502,21 @@ else
set FMU_MODE rcin
fi
if [ $OUTPUT_MODE == fmu ]
then
if fmu mode_$FMU_MODE $FMU_ARGS
then
else
echo "FMU start failed" >> $LOG_FILE
tune_control play -m ${TUNE_ERR}
fi
fi
if [ $OUTPUT_MODE == io -o $OUTPUT_MODE == uavcan_esc ]
then
sh /etc/init.d/rc.io
fi
#
# Start IO or FMU for RC PPM input if needed.
#
@@ -530,13 +524,7 @@ else
then
if [ $OUTPUT_MODE != io ]
then
if px4io start
then
sh /etc/init.d/rc.io
else
echo "PX4IO start failed" >> $LOG_FILE
tune_control play -m ${TUNE_ERR}
fi
sh /etc/init.d/rc.io
fi
else
if [ $OUTPUT_MODE != fmu ]