mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
Handle SYS_AUTOSTART 0 the same as no valid airframe being available (#25645)
* ROMFS: do not exit airframe loading if SYS_AUTOSTART is 0 Do not treat 0 as a magic value that skips the aiframe loading. Instead leave it tot he rc.autostart to load an airframe that if finds appropriate (can be defined in external aiframe). Signed-off-by: Silvan <silvan@auterion.com> * ROMFS: adjust airframe load spacing and message/comment wording --------- Signed-off-by: Silvan <silvan@auterion.com> Co-authored-by: Silvan <silvan@auterion.com>
This commit is contained in:
@@ -228,30 +228,26 @@ else
|
|||||||
fi
|
fi
|
||||||
unset BOARD_RC_ADDITIONAL_INIT
|
unset BOARD_RC_ADDITIONAL_INIT
|
||||||
|
|
||||||
# Load airframe configuration based on SYS_AUTOSTART parameter
|
# Load airframe configuration based on SYS_AUTOSTART parameter if successful VEHICLE_TYPE gets set
|
||||||
if ! param compare SYS_AUTOSTART 0
|
# Run autogenerated ROMFS airframe script
|
||||||
|
. ${R}etc/init.d/rc.autostart
|
||||||
|
|
||||||
|
if [ ${VEHICLE_TYPE} = none ]
|
||||||
then
|
then
|
||||||
# rc.autostart directly run the right airframe script which sets the VEHICLE_TYPE
|
# Run external airframe script on SD card
|
||||||
# Look for airframe in ROMFS
|
if [ $STORAGE_AVAILABLE = yes ]
|
||||||
. ${R}etc/init.d/rc.autostart
|
|
||||||
|
|
||||||
if [ ${VEHICLE_TYPE} = none ]
|
|
||||||
then
|
then
|
||||||
# Use external startup file
|
. ${R}etc/init.d/rc.autostart_ext
|
||||||
if [ $STORAGE_AVAILABLE = yes ]
|
else
|
||||||
then
|
echo "ERROR [init] SD not mounted, skipping external airframe"
|
||||||
. ${R}etc/init.d/rc.autostart_ext
|
|
||||||
else
|
|
||||||
echo "ERROR [init] SD card not mounted - can't load external airframe"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ${VEHICLE_TYPE} = none ]
|
if [ ${VEHICLE_TYPE} = none ]
|
||||||
then
|
then
|
||||||
echo "ERROR [init] No airframe file found for SYS_AUTOSTART value"
|
echo "ERROR [init] No airframe file found for SYS_AUTOSTART value"
|
||||||
param set SYS_AUTOSTART 0
|
param set SYS_AUTOSTART 0
|
||||||
tune_control play error
|
tune_control play error
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check parameter version and reset upon airframe configuration version mismatch.
|
# Check parameter version and reset upon airframe configuration version mismatch.
|
||||||
|
|||||||
Reference in New Issue
Block a user