mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 20:11:36 +08:00
ROMFS: fix SYS_USE_IO==0
When SYS_USE_IO was disabled, px4io would not start and thus there was no RC. SYS_USE_IO=0 is interesting on Quads to avoid the IO and reduce output latency. Tested on Pixhawk 1 and Pixhawk 4
This commit is contained in:
@@ -125,6 +125,11 @@ then
|
|||||||
set MIXER_AUX none
|
set MIXER_AUX none
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $USE_IO == no ]
|
||||||
|
then
|
||||||
|
set MIXER_AUX none
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $MIXER_AUX != none -a $AUX_MODE != none ]
|
if [ $MIXER_AUX != none -a $AUX_MODE != none ]
|
||||||
then
|
then
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -321,60 +321,57 @@ then
|
|||||||
|
|
||||||
set IO_PRESENT no
|
set IO_PRESENT no
|
||||||
|
|
||||||
if [ $USE_IO == yes ]
|
#
|
||||||
|
# Check if PX4IO present and update firmware if needed
|
||||||
|
#
|
||||||
|
if [ -f /etc/extras/px4io-v2.bin ]
|
||||||
then
|
then
|
||||||
#
|
set IO_FILE /etc/extras/px4io-v2.bin
|
||||||
# Check if PX4IO present and update firmware if needed
|
|
||||||
#
|
if px4io checkcrc ${IO_FILE}
|
||||||
if [ -f /etc/extras/px4io-v2.bin ]
|
|
||||||
then
|
then
|
||||||
set IO_FILE /etc/extras/px4io-v2.bin
|
set IO_PRESENT yes
|
||||||
|
else
|
||||||
|
tone_alarm MLL32CP8MB
|
||||||
|
|
||||||
if px4io checkcrc ${IO_FILE}
|
if px4io start
|
||||||
then
|
then
|
||||||
set IO_PRESENT yes
|
# try to safe px4 io so motor outputs dont go crazy
|
||||||
else
|
if px4io safety_on
|
||||||
tone_alarm MLL32CP8MB
|
|
||||||
|
|
||||||
if px4io start
|
|
||||||
then
|
then
|
||||||
# try to safe px4 io so motor outputs dont go crazy
|
# success! no-op
|
||||||
if px4io safety_on
|
|
||||||
then
|
|
||||||
# success! no-op
|
|
||||||
else
|
|
||||||
# px4io did not respond to the safety command
|
|
||||||
px4io stop
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if px4io forceupdate 14662 ${IO_FILE}
|
|
||||||
then
|
|
||||||
usleep 10000
|
|
||||||
if px4io checkcrc ${IO_FILE}
|
|
||||||
then
|
|
||||||
echo "PX4IO CRC OK after updating" >> $LOG_FILE
|
|
||||||
tone_alarm MLL8CDE
|
|
||||||
|
|
||||||
set IO_PRESENT yes
|
|
||||||
else
|
|
||||||
echo "PX4IO update failed" >> $LOG_FILE
|
|
||||||
tone_alarm ${TUNE_ERR}
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "PX4IO update failed" >> $LOG_FILE
|
# px4io did not respond to the safety command
|
||||||
tune_control play -m ${TUNE_ERR}
|
px4io stop
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
unset IO_FILE
|
|
||||||
|
|
||||||
if [ $IO_PRESENT == no ]
|
if px4io forceupdate 14662 ${IO_FILE}
|
||||||
then
|
then
|
||||||
echo "PX4IO not found" >> $LOG_FILE
|
usleep 10000
|
||||||
tune_control play -m ${TUNE_ERR}
|
if px4io checkcrc ${IO_FILE}
|
||||||
|
then
|
||||||
|
echo "PX4IO CRC OK after updating" >> $LOG_FILE
|
||||||
|
tone_alarm MLL8CDE
|
||||||
|
|
||||||
|
set IO_PRESENT yes
|
||||||
|
else
|
||||||
|
echo "PX4IO update failed" >> $LOG_FILE
|
||||||
|
tone_alarm ${TUNE_ERR}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "PX4IO update failed" >> $LOG_FILE
|
||||||
|
tune_control play -m ${TUNE_ERR}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
unset IO_FILE
|
||||||
|
|
||||||
|
if [ $USE_IO == yes -a $IO_PRESENT == no ]
|
||||||
|
then
|
||||||
|
echo "PX4IO not found" >> $LOG_FILE
|
||||||
|
tune_control play -m ${TUNE_ERR}
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set default output if not set
|
# Set default output if not set
|
||||||
|
|||||||
Reference in New Issue
Block a user