Skip to content
Snippets Groups Projects
Commit 9ba2e91f authored by Beat Küng's avatar Beat Küng Committed by Daniel Agar
Browse files

ROMFS: avoid empty 'then else' clause, it's an error in bash

Use 'if ! <cmd>' instead.
parent d4c7dbc9
No related branches found
No related tags found
No related merge requests found
......@@ -10,9 +10,4 @@
sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ]
then
fi
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
# 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
else
if param compare MNT_MODE_OUT 0
then
set MIXER_AUX mount
......@@ -69,9 +68,8 @@ then
set MKBLCTRL_ARG "-mkmode +"
fi
if mkblctrl $MKBLCTRL_ARG
if ! mkblctrl $MKBLCTRL_ARG
then
else
# Error tune.
tune_control play -t 2
fi
......@@ -79,9 +77,8 @@ then
if [ $OUTPUT_MODE == hil ]
then
if pwm_out_sim start
if ! pwm_out_sim start
then
else
# Error tune.
tune_control play -t 2
fi
......@@ -89,9 +86,8 @@ then
if [ $OUTPUT_MODE == fmu ]
then
if fmu mode_$FMU_MODE $FMU_ARGS
if ! fmu mode_$FMU_MODE $FMU_ARGS
then
else
echo "FMU start failed" >> $LOG_FILE
# Error tune.
tune_control play -t 2
......
......@@ -11,10 +11,8 @@
# Begin Setup for board specific configurations. #
###############################################################################
if ver hwcmp AEROFC_V1
if ! ver hwcmp AEROFC_V1
then
# don't start mavlink ttyACM0 on aerofc_v1
else
# Start MAVLink
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
fi
......@@ -74,9 +72,8 @@ then
fi
fi
if [ "x$MAVLINK_F" == xnone ]
if [ "x$MAVLINK_F" != xnone ]
then
else
mavlink start ${MAVLINK_F}
fi
......
......@@ -9,14 +9,10 @@
# Begin Setup for board specific configurations. #
###############################################################################
if ver hwcmp AEROFC_V1 OMNIBUS_F4SD
if ! ver hwcmp AEROFC_V1 OMNIBUS_F4SD
then
# Aero FC uses separate driver
else
if ver hwcmp CRAZYFLIE
if ! ver hwcmp CRAZYFLIE
then
# Crazyflie uses separate driver
else
# Configure all I2C buses to 100 KHz as they
# are all external or slow
fmu i2c 1 100000
......@@ -209,11 +205,10 @@ then
# As we will use the external mag and the ICM-20608-G
# V2 build hwtypecmp is always false
# V3 build hwtypecmp supports V2|V2M|V30
if ver hwtypecmp V2M
if ! ver hwtypecmp V2M
then
# On the PixhawkMini the mpu9250 has been disabled due to HW errata
else
mpu9250 start
# else: On the PixhawkMini the mpu9250 has been disabled due to HW errata
fi
l3gd20 start
......@@ -240,14 +235,12 @@ then
# expansion i2c used for BMM150 rotated by 90deg
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
# hmc5883 internal SPI bus is rotated 90 deg yaw
else
if lis3mdl start
# lis3mdl internal SPI bus is rotated 90 deg yaw
if ! lis3mdl start
then
# lis3mdl internal SPI bus is rotated 90 deg yaw
else
# BMI055 gyro internal SPI bus
bmi055 -G start
fi
......@@ -257,14 +250,12 @@ then
# 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.
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
# ICM20602 internal SPI bus ICM-20608-G is rotated 90 deg yaw
else
if mpu6000 -R 2 -T 20608 start
# ICM20608 internal SPI bus ICM-20602-G is rotated 90 deg yaw
if ! mpu6000 -R 2 -T 20608 start
then
# ICM20608 internal SPI bus ICM-20602-G is rotated 90 deg yaw
else
# BMI055 accel internal SPI bus
bmi055 -A start
fi
......@@ -274,10 +265,9 @@ then
# 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.
if mpu9250 -R 2 start
# mpu9250 internal SPI bus mpu9250 is rotated 90 deg yaw
if ! mpu9250 -R 2 start
then
# mpu9250 internal SPI bus mpu9250 is rotated 90 deg yaw
else
# BMI160 internal SPI bus
bmi160 start
fi
......@@ -299,9 +289,8 @@ fi
if ver hwcmp OMNIBUS_F4SD
then
if mpu6000 -R 12 -s start
if ! mpu6000 -R 12 -s start
then
else
# some boards such as the Hobbywing XRotor F4 G2 use the ICM-20602
mpu6000 -R 12 -T 20602 -s start
fi
......
......@@ -131,10 +131,9 @@ else
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
# AEROCORE2 shouldn't have an sd card and CF2 may optionally have an sd card.
else
# Run no SD alarm.
if [ $LOG_FILE == /dev/null ]
then
......@@ -194,20 +193,16 @@ else
# Load parameters.
#
param select $PARAM_FILE
if param load
if ! param load
then
else
if param reset
then
fi
param reset
fi
#
# Start system state indicator.
#
if rgbled start
if ! rgbled start
then
else
if blinkm start
then
blinkm systemstate
......@@ -289,9 +284,8 @@ else
#
# Set parameters and env variables for selected AUTOSTART.
#
if param compare SYS_AUTOSTART 0
if ! param compare SYS_AUTOSTART 0
then
else
sh /etc/init.d/rc.autostart
fi
......@@ -351,10 +345,8 @@ else
if px4io start
then
# Try to safety px4 io so motor outputs don't go crazy.
if px4io safety_on
if ! px4io safety_on
then
# success! no-op
else
# px4io did not respond to the safety command.
px4io stop
fi
......@@ -507,12 +499,9 @@ else
#
# 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
else
if vmount start
then
fi
vmount start
fi
#
......
......@@ -61,12 +61,9 @@ then
fi
param select $PARAM_FILE
if param load
if !param load
then
else
if param reset
then
fi
param reset
fi
tone_alarm start
......
Subproject commit 36806ba3d84c0fa07ed86857d4c92a997b7cd194
Subproject commit d19cc40bdca5416a0891798f4b13bfa14f07abeb
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment