mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 05:21:36 +08:00
HOTFIX: Fix startup order
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
# can change this to prevent automatic startup of the flight script.
|
# can change this to prevent automatic startup of the flight script.
|
||||||
#
|
#
|
||||||
set MODE autostart
|
set MODE autostart
|
||||||
set USB autoconnect
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Try to mount the microSD card.
|
# Try to mount the microSD card.
|
||||||
@@ -42,31 +41,44 @@ then
|
|||||||
sh /fs/microsd/etc/rc.txt
|
sh /fs/microsd/etc/rc.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# Check for USB host
|
|
||||||
#
|
|
||||||
if [ $USB != autoconnect ]
|
|
||||||
then
|
|
||||||
echo "[init] not connecting USB"
|
|
||||||
else
|
|
||||||
if sercon
|
|
||||||
then
|
|
||||||
echo "[init] USB interface connected"
|
|
||||||
else
|
|
||||||
if [ -f /dev/ttyACM0 ]
|
|
||||||
echo "[init] NSH via USB"
|
|
||||||
then
|
|
||||||
else
|
|
||||||
echo "[init] No USB connected"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# if this is an APM build then there will be a rc.APM script
|
# if this is an APM build then there will be a rc.APM script
|
||||||
# from an EXTERNAL_SCRIPTS build option
|
# from an EXTERNAL_SCRIPTS build option
|
||||||
if [ -f /etc/init.d/rc.APM ]
|
if [ -f /etc/init.d/rc.APM ]
|
||||||
then
|
then
|
||||||
echo Running rc.APM
|
if sercon
|
||||||
|
then
|
||||||
|
echo "[init] USB interface connected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Running rc.APM"
|
||||||
# if APM startup is successful then nsh will exit
|
# if APM startup is successful then nsh will exit
|
||||||
sh /etc/init.d/rc.APM
|
sh /etc/init.d/rc.APM
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $MODE == autostart ]
|
||||||
|
then
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start the ORB (first app to start)
|
||||||
|
#
|
||||||
|
uorb start
|
||||||
|
|
||||||
|
#
|
||||||
|
# Load microSD params
|
||||||
|
#
|
||||||
|
if ramtron start
|
||||||
|
then
|
||||||
|
param select /ramtron/params
|
||||||
|
if [ -f /ramtron/params ]
|
||||||
|
then
|
||||||
|
param load /ramtron/params
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
param select /fs/microsd/params
|
||||||
|
if [ -f /fs/microsd/params ]
|
||||||
|
then
|
||||||
|
param load /fs/microsd/params
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user