Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROMFS: fix SYS_USE_IO==0 #9551

Merged
merged 1 commit into from
May 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ROMFS/px4fmu_common/init.d/rc.interface
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ then
set MIXER_AUX none
fi

if [ $USE_IO == no ]
then
set MIXER_AUX none
fi

if [ $MIXER_AUX != none -a $AUX_MODE != none ]
then
#
Expand Down
75 changes: 36 additions & 39 deletions ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -321,59 +321,56 @@ then

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
#
# Check if PX4IO present and update firmware if needed
#
if [ -f /etc/extras/px4io-v2.bin ]
set IO_FILE /etc/extras/px4io-v2.bin

if px4io checkcrc ${IO_FILE}
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
set IO_PRESENT yes
else
tone_alarm MLL32CP8MB

if px4io start
# try to safe px4 io so motor outputs dont go crazy
if px4io safety_on
then
# try to safe px4 io so motor outputs dont go crazy
if px4io safety_on
then
# success! no-op
else
# px4io did not respond to the safety command
px4io stop
fi
# success! no-op
else
# px4io did not respond to the safety command
px4io stop
fi
fi

if px4io forceupdate 14662 ${IO_FILE}
if px4io forceupdate 14662 ${IO_FILE}
then
usleep 10000
if px4io checkcrc ${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
echo "PX4IO CRC OK after updating" >> $LOG_FILE
tone_alarm MLL8CDE

set IO_PRESENT yes
else
echo "PX4IO update failed" >> $LOG_FILE
tune_control play -m ${TUNE_ERR}
tone_alarm ${TUNE_ERR}
fi
else
echo "PX4IO update failed" >> $LOG_FILE
tune_control play -m ${TUNE_ERR}
fi
fi
unset IO_FILE
fi
unset IO_FILE

if [ $IO_PRESENT == no ]
then
echo "PX4IO not found" >> $LOG_FILE
tune_control play -m ${TUNE_ERR}
fi
if [ $USE_IO == yes -a $IO_PRESENT == no ]
then
echo "PX4IO not found" >> $LOG_FILE
tune_control play -m ${TUNE_ERR}
fi

#
Expand Down