mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 20:43:33 +08:00
ROMFS: avoid empty 'then else' clause, it's an error in bash
Use 'if ! <cmd>' instead.
This commit is contained in:
@@ -10,9 +10,4 @@
|
|||||||
|
|
||||||
sh /etc/init.d/rc.fw_defaults
|
sh /etc/init.d/rc.fw_defaults
|
||||||
|
|
||||||
if [ $AUTOCNF == yes ]
|
|
||||||
then
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
set MIXER fw_generic_wing
|
set MIXER fw_generic_wing
|
||||||
|
|||||||
@@ -17,9 +17,8 @@ set SDCARD_MIXERS_PATH /fs/microsd/etc/mixers
|
|||||||
# If mount (gimbal) control is enabled and output mode is AUX, set the aux
|
# If mount (gimbal) control is enabled and output mode is AUX, set the aux
|
||||||
# mixer to mount (override the airframe-specific MIXER_AUX setting).
|
# mixer to mount (override the airframe-specific MIXER_AUX setting).
|
||||||
#
|
#
|
||||||
if param compare MNT_MODE_IN -1
|
if ! param compare MNT_MODE_IN -1
|
||||||
then
|
then
|
||||||
else
|
|
||||||
if param compare MNT_MODE_OUT 0
|
if param compare MNT_MODE_OUT 0
|
||||||
then
|
then
|
||||||
set MIXER_AUX mount
|
set MIXER_AUX mount
|
||||||
@@ -69,9 +68,8 @@ then
|
|||||||
set MKBLCTRL_ARG "-mkmode +"
|
set MKBLCTRL_ARG "-mkmode +"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if mkblctrl $MKBLCTRL_ARG
|
if ! mkblctrl $MKBLCTRL_ARG
|
||||||
then
|
then
|
||||||
else
|
|
||||||
# Error tune.
|
# Error tune.
|
||||||
tune_control play -t 2
|
tune_control play -t 2
|
||||||
fi
|
fi
|
||||||
@@ -79,9 +77,8 @@ then
|
|||||||
|
|
||||||
if [ $OUTPUT_MODE == hil ]
|
if [ $OUTPUT_MODE == hil ]
|
||||||
then
|
then
|
||||||
if pwm_out_sim start
|
if ! pwm_out_sim start
|
||||||
then
|
then
|
||||||
else
|
|
||||||
# Error tune.
|
# Error tune.
|
||||||
tune_control play -t 2
|
tune_control play -t 2
|
||||||
fi
|
fi
|
||||||
@@ -89,9 +86,8 @@ then
|
|||||||
|
|
||||||
if [ $OUTPUT_MODE == fmu ]
|
if [ $OUTPUT_MODE == fmu ]
|
||||||
then
|
then
|
||||||
if fmu mode_$FMU_MODE $FMU_ARGS
|
if ! fmu mode_$FMU_MODE $FMU_ARGS
|
||||||
then
|
then
|
||||||
else
|
|
||||||
echo "FMU start failed" >> $LOG_FILE
|
echo "FMU start failed" >> $LOG_FILE
|
||||||
# Error tune.
|
# Error tune.
|
||||||
tune_control play -t 2
|
tune_control play -t 2
|
||||||
|
|||||||
@@ -11,10 +11,8 @@
|
|||||||
# Begin Setup for board specific configurations. #
|
# Begin Setup for board specific configurations. #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
if ver hwcmp AEROFC_V1
|
if ! ver hwcmp AEROFC_V1
|
||||||
then
|
then
|
||||||
# don't start mavlink ttyACM0 on aerofc_v1
|
|
||||||
else
|
|
||||||
# Start MAVLink
|
# Start MAVLink
|
||||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||||
fi
|
fi
|
||||||
@@ -74,9 +72,8 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x$MAVLINK_F" == xnone ]
|
if [ "x$MAVLINK_F" != xnone ]
|
||||||
then
|
then
|
||||||
else
|
|
||||||
mavlink start ${MAVLINK_F}
|
mavlink start ${MAVLINK_F}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,10 @@
|
|||||||
# Begin Setup for board specific configurations. #
|
# Begin Setup for board specific configurations. #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
if ver hwcmp AEROFC_V1 OMNIBUS_F4SD
|
if ! ver hwcmp AEROFC_V1 OMNIBUS_F4SD
|
||||||
then
|
then
|
||||||
# Aero FC uses separate driver
|
if ! ver hwcmp CRAZYFLIE
|
||||||
else
|
|
||||||
if ver hwcmp CRAZYFLIE
|
|
||||||
then
|
then
|
||||||
# Crazyflie uses separate driver
|
|
||||||
else
|
|
||||||
# Configure all I2C buses to 100 KHz as they
|
# Configure all I2C buses to 100 KHz as they
|
||||||
# are all external or slow
|
# are all external or slow
|
||||||
fmu i2c 1 100000
|
fmu i2c 1 100000
|
||||||
@@ -209,11 +205,10 @@ then
|
|||||||
# As we will use the external mag and the ICM-20608-G
|
# As we will use the external mag and the ICM-20608-G
|
||||||
# V2 build hwtypecmp is always false
|
# V2 build hwtypecmp is always false
|
||||||
# V3 build hwtypecmp supports V2|V2M|V30
|
# V3 build hwtypecmp supports V2|V2M|V30
|
||||||
if ver hwtypecmp V2M
|
if ! ver hwtypecmp V2M
|
||||||
then
|
then
|
||||||
# On the PixhawkMini the mpu9250 has been disabled due to HW errata
|
|
||||||
else
|
|
||||||
mpu9250 start
|
mpu9250 start
|
||||||
|
# else: On the PixhawkMini the mpu9250 has been disabled due to HW errata
|
||||||
fi
|
fi
|
||||||
|
|
||||||
l3gd20 start
|
l3gd20 start
|
||||||
@@ -240,14 +235,12 @@ then
|
|||||||
# expansion i2c used for BMM150 rotated by 90deg
|
# expansion i2c used for BMM150 rotated by 90deg
|
||||||
bmm150 -R 2 start
|
bmm150 -R 2 start
|
||||||
|
|
||||||
if hmc5883 -C -T -S -R 2 start
|
# hmc5883 internal SPI bus is rotated 90 deg yaw
|
||||||
|
if ! hmc5883 -C -T -S -R 2 start
|
||||||
then
|
then
|
||||||
# hmc5883 internal SPI bus is rotated 90 deg yaw
|
# lis3mdl internal SPI bus is rotated 90 deg yaw
|
||||||
else
|
if ! lis3mdl start
|
||||||
if lis3mdl start
|
|
||||||
then
|
then
|
||||||
# lis3mdl internal SPI bus is rotated 90 deg yaw
|
|
||||||
else
|
|
||||||
# BMI055 gyro internal SPI bus
|
# BMI055 gyro internal SPI bus
|
||||||
bmi055 -G start
|
bmi055 -G start
|
||||||
fi
|
fi
|
||||||
@@ -257,14 +250,12 @@ then
|
|||||||
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
||||||
# will prevent the incorrect driver from a successful initialization.
|
# will prevent the incorrect driver from a successful initialization.
|
||||||
|
|
||||||
if mpu6000 -R 2 -T 20602 start
|
# ICM20602 internal SPI bus ICM-20608-G is rotated 90 deg yaw
|
||||||
|
if ! mpu6000 -R 2 -T 20602 start
|
||||||
then
|
then
|
||||||
# ICM20602 internal SPI bus ICM-20608-G is rotated 90 deg yaw
|
# ICM20608 internal SPI bus ICM-20602-G is rotated 90 deg yaw
|
||||||
else
|
if ! mpu6000 -R 2 -T 20608 start
|
||||||
if mpu6000 -R 2 -T 20608 start
|
|
||||||
then
|
then
|
||||||
# ICM20608 internal SPI bus ICM-20602-G is rotated 90 deg yaw
|
|
||||||
else
|
|
||||||
# BMI055 accel internal SPI bus
|
# BMI055 accel internal SPI bus
|
||||||
bmi055 -A start
|
bmi055 -A start
|
||||||
fi
|
fi
|
||||||
@@ -274,10 +265,9 @@ then
|
|||||||
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
||||||
# will prevent the incorrect driver from a successful initialization.
|
# will prevent the incorrect driver from a successful initialization.
|
||||||
|
|
||||||
if mpu9250 -R 2 start
|
# mpu9250 internal SPI bus mpu9250 is rotated 90 deg yaw
|
||||||
|
if ! mpu9250 -R 2 start
|
||||||
then
|
then
|
||||||
# mpu9250 internal SPI bus mpu9250 is rotated 90 deg yaw
|
|
||||||
else
|
|
||||||
# BMI160 internal SPI bus
|
# BMI160 internal SPI bus
|
||||||
bmi160 start
|
bmi160 start
|
||||||
fi
|
fi
|
||||||
@@ -299,9 +289,8 @@ fi
|
|||||||
|
|
||||||
if ver hwcmp OMNIBUS_F4SD
|
if ver hwcmp OMNIBUS_F4SD
|
||||||
then
|
then
|
||||||
if mpu6000 -R 12 -s start
|
if ! mpu6000 -R 12 -s start
|
||||||
then
|
then
|
||||||
else
|
|
||||||
# some boards such as the Hobbywing XRotor F4 G2 use the ICM-20602
|
# some boards such as the Hobbywing XRotor F4 G2 use the ICM-20602
|
||||||
mpu6000 -R 12 -T 20602 -s start
|
mpu6000 -R 12 -T 20602 -s start
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -131,10 +131,9 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ver hwcmp CRAZYFLIE AEROCORE2
|
# AEROCORE2 shouldn't have an sd card and CF2 may optionally have an sd card.
|
||||||
|
if ! ver hwcmp CRAZYFLIE AEROCORE2
|
||||||
then
|
then
|
||||||
# AEROCORE2 shouldn't have an sd card and CF2 may optionally have an sd card.
|
|
||||||
else
|
|
||||||
# Run no SD alarm.
|
# Run no SD alarm.
|
||||||
if [ $LOG_FILE == /dev/null ]
|
if [ $LOG_FILE == /dev/null ]
|
||||||
then
|
then
|
||||||
@@ -194,20 +193,16 @@ else
|
|||||||
# Load parameters.
|
# Load parameters.
|
||||||
#
|
#
|
||||||
param select $PARAM_FILE
|
param select $PARAM_FILE
|
||||||
if param load
|
if ! param load
|
||||||
then
|
then
|
||||||
else
|
param reset
|
||||||
if param reset
|
|
||||||
then
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Start system state indicator.
|
# Start system state indicator.
|
||||||
#
|
#
|
||||||
if rgbled start
|
if ! rgbled start
|
||||||
then
|
then
|
||||||
else
|
|
||||||
if blinkm start
|
if blinkm start
|
||||||
then
|
then
|
||||||
blinkm systemstate
|
blinkm systemstate
|
||||||
@@ -289,9 +284,8 @@ else
|
|||||||
#
|
#
|
||||||
# Set parameters and env variables for selected AUTOSTART.
|
# Set parameters and env variables for selected AUTOSTART.
|
||||||
#
|
#
|
||||||
if param compare SYS_AUTOSTART 0
|
if ! param compare SYS_AUTOSTART 0
|
||||||
then
|
then
|
||||||
else
|
|
||||||
sh /etc/init.d/rc.autostart
|
sh /etc/init.d/rc.autostart
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -351,10 +345,8 @@ else
|
|||||||
if px4io start
|
if px4io start
|
||||||
then
|
then
|
||||||
# Try to safety px4 io so motor outputs don't go crazy.
|
# Try to safety px4 io so motor outputs don't go crazy.
|
||||||
if px4io safety_on
|
if ! px4io safety_on
|
||||||
then
|
then
|
||||||
# success! no-op
|
|
||||||
else
|
|
||||||
# px4io did not respond to the safety command.
|
# px4io did not respond to the safety command.
|
||||||
px4io stop
|
px4io stop
|
||||||
fi
|
fi
|
||||||
@@ -507,12 +499,9 @@ else
|
|||||||
#
|
#
|
||||||
# Start vmount to control mounts such as gimbals, disabled by default.
|
# Start vmount to control mounts such as gimbals, disabled by default.
|
||||||
#
|
#
|
||||||
if param compare MNT_MODE_IN -1
|
if ! param compare MNT_MODE_IN -1
|
||||||
then
|
then
|
||||||
else
|
vmount start
|
||||||
if vmount start
|
|
||||||
then
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -61,12 +61,9 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
param select $PARAM_FILE
|
param select $PARAM_FILE
|
||||||
if param load
|
if !param load
|
||||||
then
|
then
|
||||||
else
|
param reset
|
||||||
if param reset
|
|
||||||
then
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tone_alarm start
|
tone_alarm start
|
||||||
|
|||||||
Submodule platforms/nuttx/NuttX/apps updated: 36806ba3d8...d19cc40bdc
Reference in New Issue
Block a user