NuttX shell scripts: replace operator == with =

- NuttX supports both versions
- POSIX shell only supports '='
This commit is contained in:
Beat Küng 2018-09-27 11:11:12 +02:00 committed by Lorenz Meier
parent 4c90d2c025
commit 37338e442f
75 changed files with 146 additions and 147 deletions

View File

@ -172,12 +172,11 @@ set_target_properties(romfs PROPERTIES LINKER_LANGUAGE C)
find_program(SHELLCHECK_PATH shellcheck) find_program(SHELLCHECK_PATH shellcheck)
if(SHELLCHECK_PATH) if(SHELLCHECK_PATH)
# TODO: fix SC2039, SC2086, SC2166 # TODO: fix SC2086, SC2166
add_custom_target(shellcheck add_custom_target(shellcheck
COMMAND ${SHELLCHECK_PATH} --shell=sh COMMAND ${SHELLCHECK_PATH} --shell=sh
--exclude=SC2121 # SC2121: To assign a variable, use just 'var=value' --exclude=SC2121 # SC2121: To assign a variable, use just 'var=value'
--exclude=SC2086 # SC2086: Double quote to prevent globbing and word splitting. --exclude=SC2086 # SC2086: Double quote to prevent globbing and word splitting.
--exclude=SC2039 # SC2039: In POSIX sh, == in place of = is undefined.
--exclude=SC2166 # SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. --exclude=SC2166 # SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
--exclude=SC2154 # SC2154: <var> is referenced but not assigned (NuttX uses different asssignment) --exclude=SC2154 # SC2154: <var> is referenced but not assigned (NuttX uses different asssignment)
init.d/* init.d/*

View File

@ -17,7 +17,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 3 param set BAT_N_CELLS 3

View File

@ -22,7 +22,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 6.5 param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.1 param set MC_ROLLRATE_P 0.1

View File

@ -20,7 +20,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
# TODO tune roll/pitch separately # TODO tune roll/pitch separately
param set MC_ROLL_P 7.0 param set MC_ROLL_P 7.0

View File

@ -22,7 +22,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 4 param set BAT_N_CELLS 4

View File

@ -22,7 +22,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 6 param set BAT_N_CELLS 6
param set BAT_V_EMPTY 3.5 param set BAT_V_EMPTY 3.5

View File

@ -10,7 +10,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 3 param set BAT_N_CELLS 3

View File

@ -19,7 +19,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_PITCH_P 4.0 param set MC_PITCH_P 4.0
param set MC_PITCHRATE_P 0.24 param set MC_PITCHRATE_P 0.24

View File

@ -20,7 +20,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set PWM_AUX_DIS5 950 param set PWM_AUX_DIS5 950
param set PWM_RATE 400 param set PWM_RATE 400

View File

@ -15,7 +15,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 6.0 param set MC_ROLL_P 6.0
param set MC_ROLLRATE_P 0.12 param set MC_ROLLRATE_P 0.12

View File

@ -20,7 +20,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 7.0 param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.19 param set MC_ROLLRATE_P 0.19

View File

@ -10,7 +10,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set PWM_MAX 2000 param set PWM_MAX 2000
param set PWM_RATE 400 param set PWM_RATE 400

View File

@ -21,7 +21,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set PWM_MAX 2000 param set PWM_MAX 2000
param set PWM_RATE 400 param set PWM_RATE 400

View File

@ -20,7 +20,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set PWM_AUX_DIS5 950 param set PWM_AUX_DIS5 950

View File

@ -18,7 +18,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 6.5 param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.15 param set MC_ROLLRATE_P 0.15

View File

@ -10,7 +10,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 7.0 param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15 param set MC_ROLLRATE_P 0.15

View File

@ -10,7 +10,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_THR_CRUISE 65.0 param set FW_THR_CRUISE 65.0
param set FW_PR_P 0.08 param set FW_PR_P 0.08

View File

@ -10,7 +10,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_AIRSPD_MAX 22.0 param set FW_AIRSPD_MAX 22.0
param set FW_AIRSPD_MIN 14.0 param set FW_AIRSPD_MIN 14.0

View File

@ -12,7 +12,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set PWM_AUX_DISARMED 1000 param set PWM_AUX_DISARMED 1000
param set PWM_AUX_MAX 2000 param set PWM_AUX_MAX 2000

View File

@ -19,7 +19,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set CBRK_AIRSPD_CHK 162128 param set CBRK_AIRSPD_CHK 162128

View File

@ -19,7 +19,7 @@
sh /etc/init.d/rc.vtol_defaults sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_CAPACITY 23000 param set BAT_CAPACITY 23000
param set BAT_N_CELLS 4 param set BAT_N_CELLS 4

View File

@ -16,7 +16,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
set MIXER coax set MIXER coax
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 6.5 param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.17 param set MC_ROLLRATE_P 0.17

View File

@ -23,7 +23,7 @@ set MIXER blade130
#set PWM_OUT 1234 #set PWM_OUT 1234
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set ATT_BIAS_MAX 0.0 param set ATT_BIAS_MAX 0.0

View File

@ -21,7 +21,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set PWM_AUX_RATE 50 param set PWM_AUX_RATE 50
param set PWM_RATE 50 param set PWM_RATE 50

View File

@ -22,7 +22,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_AIRSPD_MIN 10 param set FW_AIRSPD_MIN 10
param set FW_AIRSPD_TRIM 15 param set FW_AIRSPD_TRIM 15

View File

@ -23,7 +23,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_AIRSPD_MIN 10 param set FW_AIRSPD_MIN 10
param set FW_AIRSPD_TRIM 15 param set FW_AIRSPD_TRIM 15

View File

@ -25,7 +25,7 @@
set VEHICLE_TYPE mc set VEHICLE_TYPE mc
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set NAV_ACC_RAD 2.0 param set NAV_ACC_RAD 2.0

View File

@ -18,7 +18,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_AIRSPD_MAX 15 param set FW_AIRSPD_MAX 15
param set FW_AIRSPD_MIN 10 param set FW_AIRSPD_MIN 10

View File

@ -20,7 +20,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_AIRSPD_MIN 13 param set FW_AIRSPD_MIN 13
param set FW_AIRSPD_TRIM 15 param set FW_AIRSPD_TRIM 15

View File

@ -18,7 +18,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_AIRSPD_MIN 15 param set FW_AIRSPD_MIN 15
param set FW_AIRSPD_TRIM 20 param set FW_AIRSPD_TRIM 20

View File

@ -20,7 +20,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 2 param set BAT_N_CELLS 2
param set FW_AIRSPD_MAX 15 param set FW_AIRSPD_MAX 15

View File

@ -10,7 +10,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_AIRSPD_MAX 30 param set FW_AIRSPD_MAX 30
param set FW_AIRSPD_MIN 13 param set FW_AIRSPD_MIN 13

View File

@ -20,7 +20,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_AIRSPD_MIN 15 param set FW_AIRSPD_MIN 15
param set FW_AIRSPD_TRIM 20 param set FW_AIRSPD_TRIM 20

View File

@ -20,7 +20,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
#################################### ####################################

View File

@ -10,7 +10,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set FW_AIRSPD_MAX 25 param set FW_AIRSPD_MAX 25
param set FW_AIRSPD_MIN 12.5 param set FW_AIRSPD_MIN 12.5

View File

@ -22,7 +22,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set PWM_AUX_RATE 50 param set PWM_AUX_RATE 50
fi fi

View File

@ -12,7 +12,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 8.0 param set MC_ROLL_P 8.0
param set MC_ROLLRATE_P 0.08 param set MC_ROLLRATE_P 0.08

View File

@ -15,7 +15,7 @@ sh /etc/init.d/4002_quad_x_mount
# see http://www.zhiyun-tech.com/uploadfile/datedown/instruction/Tiny2_English_instructionV1.03.pdf # see http://www.zhiyun-tech.com/uploadfile/datedown/instruction/Tiny2_English_instructionV1.03.pdf
# under Gimbal Connection Instruction # under Gimbal Connection Instruction
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set PWM_AUX_DISARMED 1520 param set PWM_AUX_DISARMED 1520
param set PWM_AUX_MIN 1020 param set PWM_AUX_MIN 1020

View File

@ -10,7 +10,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set ATT_BIAS_MAX 0.0 param set ATT_BIAS_MAX 0.0

View File

@ -10,7 +10,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 7.0 param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15 param set MC_ROLLRATE_P 0.15

View File

@ -10,7 +10,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 7.0 param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15 param set MC_ROLLRATE_P 0.15

View File

@ -10,7 +10,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 7.0 param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.16 param set MC_ROLLRATE_P 0.16

View File

@ -20,7 +20,7 @@ sh /etc/init.d/rc.mc_defaults
# #
# Load default params for this platform # Load default params for this platform
# #
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
# Set all params here, then disable autoconfig # Set all params here, then disable autoconfig
param set MC_ROLL_P 6.5 param set MC_ROLL_P 6.5

View File

@ -10,7 +10,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 6.5 param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.18 param set MC_ROLLRATE_P 0.18

View File

@ -17,7 +17,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 7.0 param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.1 param set MC_ROLLRATE_P 0.1

View File

@ -16,7 +16,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
# tuning # tuning
param set MC_PITCHRATE_P 0.11 param set MC_PITCHRATE_P 0.11

View File

@ -10,7 +10,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 6.5 param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.14 param set MC_ROLLRATE_P 0.14

View File

@ -17,7 +17,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 6.5 param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.14 param set MC_ROLLRATE_P 0.14

View File

@ -10,7 +10,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 8.0 param set MC_ROLL_P 8.0
param set MC_ROLLRATE_P 0.08 param set MC_ROLLRATE_P 0.08

View File

@ -26,7 +26,7 @@ set MAV_TYPE 2
set PWM_OUT 1234 set PWM_OUT 1234
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set ATT_BIAS_MAX 0.0 param set ATT_BIAS_MAX 0.0

View File

@ -10,7 +10,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 6 param set BAT_N_CELLS 6

View File

@ -19,7 +19,7 @@ sh /etc/init.d/rc.mc_defaults
# #
# Load default params for this platform # Load default params for this platform
# #
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
# Set all params here, then disable autoconfig # Set all params here, then disable autoconfig

View File

@ -15,7 +15,7 @@ sh /etc/init.d/rc.mc_defaults
set MIXER zmr250 set MIXER zmr250
set PWM_OUT 1234 set PWM_OUT 1234
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set CBRK_IO_SAFETY 22027 param set CBRK_IO_SAFETY 22027

View File

@ -17,7 +17,7 @@
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 1 param set BAT_N_CELLS 1

View File

@ -15,7 +15,7 @@
# @maintainer Dennis Shtatov <densht@gmail.com> # @maintainer Dennis Shtatov <densht@gmail.com>
# #
sh /etc/init.d/4001_quad_x sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 1 param set BAT_N_CELLS 1
param set BAT_CAPACITY 240 param set BAT_CAPACITY 240

View File

@ -15,7 +15,7 @@
sh /etc/init.d/rc.ugv_defaults sh /etc/init.d/rc.ugv_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 2 param set BAT_N_CELLS 2

View File

@ -23,7 +23,7 @@ sh /etc/init.d/rc.ugv_defaults
# This section can be enabled once tuning parameters for this particular # This section can be enabled once tuning parameters for this particular
# rover model are known. It allows to configure default gains via the GUI. # rover model are known. It allows to configure default gains via the GUI.
# #
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
# PWM default value for "disarmed" mode. # PWM default value for "disarmed" mode.
# This centers the steering and throttle, which means # This centers the steering and throttle, which means

View File

@ -17,7 +17,7 @@
sh /etc/init.d/rc.ugv_defaults sh /etc/init.d/rc.ugv_defaults
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set BAT_N_CELLS 7 param set BAT_N_CELLS 7

View File

@ -7,7 +7,7 @@
set VEHICLE_TYPE fw set VEHICLE_TYPE fw
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
# #
# Default parameters for fixed wing UAVs. # Default parameters for fixed wing UAVs.

View File

@ -30,7 +30,7 @@ then
set MIXER_AUX none set MIXER_AUX none
fi fi
if [ $USE_IO == no ] if [ $USE_IO = no ]
then then
set MIXER_AUX none set MIXER_AUX none
fi fi
@ -38,12 +38,12 @@ fi
# #
# Set the default output mode if none was set. # Set the default output mode if none was set.
# #
if [ $OUTPUT_MODE == none ] if [ $OUTPUT_MODE = none ]
then then
if [ $USE_IO == yes ] if [ $USE_IO = yes ]
then then
# Enable IO output only if IO is present. # Enable IO output only if IO is present.
if [ $IO_PRESENT == yes ] if [ $IO_PRESENT = yes ]
then then
set OUTPUT_MODE io set OUTPUT_MODE io
fi fi
@ -53,17 +53,17 @@ then
fi fi
# #
# If OUTPUT_MODE == none then something is wrong with setup and we shouldn't try to enable output. # If OUTPUT_MODE = none then something is wrong with setup and we shouldn't try to enable output.
# #
if [ $OUTPUT_MODE != none ] if [ $OUTPUT_MODE != none ]
then then
if [ $OUTPUT_MODE == mkblctrl ] if [ $OUTPUT_MODE = mkblctrl ]
then then
if [ $MKBLCTRL_MODE == x ] if [ $MKBLCTRL_MODE = x ]
then then
set MKBLCTRL_ARG "-mkmode x" set MKBLCTRL_ARG "-mkmode x"
fi fi
if [ $MKBLCTRL_MODE == + ] if [ $MKBLCTRL_MODE = + ]
then then
set MKBLCTRL_ARG "-mkmode +" set MKBLCTRL_ARG "-mkmode +"
fi fi
@ -75,7 +75,7 @@ then
fi fi
fi fi
if [ $OUTPUT_MODE == hil -o $OUTPUT_MODE == sim ] if [ $OUTPUT_MODE = hil -o $OUTPUT_MODE = sim ]
then then
if ! pwm_out_sim start if ! pwm_out_sim start
then then
@ -84,7 +84,7 @@ then
fi fi
fi fi
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
@ -94,7 +94,7 @@ then
fi fi
fi fi
if [ $OUTPUT_MODE == uavcan_esc ] if [ $OUTPUT_MODE = uavcan_esc ]
then then
if param compare UAVCAN_ENABLE 0 if param compare UAVCAN_ENABLE 0
then then
@ -102,7 +102,7 @@ then
fi fi
fi fi
if [ $OUTPUT_MODE == io -o $OUTPUT_MODE == uavcan_esc ] if [ $OUTPUT_MODE = io -o $OUTPUT_MODE = uavcan_esc ]
then then
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
fi fi
@ -110,7 +110,7 @@ then
# #
# Start IO for RC input if needed. # Start IO for RC input if needed.
# #
if [ $IO_PRESENT == yes ] if [ $IO_PRESENT = yes ]
then then
if [ $OUTPUT_MODE != io ] if [ $OUTPUT_MODE != io ]
then then
@ -124,12 +124,12 @@ then
# #
# Load main mixer. # Load main mixer.
# #
if [ $MIXER_AUX == none -a $USE_IO == yes ] if [ $MIXER_AUX = none -a $USE_IO = yes ]
then then
set MIXER_AUX ${MIXER} set MIXER_AUX ${MIXER}
fi fi
if [ "$MIXER_FILE" == none ] if [ "$MIXER_FILE" = none ]
then then
if [ -f ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix ] if [ -f ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix ]
then then
@ -146,19 +146,19 @@ then
fi fi
fi fi
if [ $OUTPUT_MODE == mkblctrl ] if [ $OUTPUT_MODE = mkblctrl ]
then then
set OUTPUT_DEV /dev/mkblctrl0 set OUTPUT_DEV /dev/mkblctrl0
else else
set OUTPUT_DEV /dev/pwm_output0 set OUTPUT_DEV /dev/pwm_output0
fi fi
if [ $OUTPUT_MODE == uavcan_esc ] if [ $OUTPUT_MODE = uavcan_esc ]
then then
set OUTPUT_DEV /dev/uavcan/esc set OUTPUT_DEV /dev/uavcan/esc
fi fi
if [ $OUTPUT_MODE == tap_esc ] if [ $OUTPUT_MODE = tap_esc ]
then then
set OUTPUT_DEV /dev/tap_esc set OUTPUT_DEV /dev/tap_esc
fi fi
@ -311,7 +311,7 @@ then
fi fi
fi fi
if [ $OUTPUT_MODE == fmu -o $OUTPUT_MODE == io ] if [ $OUTPUT_MODE = fmu -o $OUTPUT_MODE = io ]
then then
if [ $PWM_OUT != none ] if [ $PWM_OUT != none ]
then then

View File

@ -2,7 +2,7 @@
# #
# PX4IO interface init script. # PX4IO interface init script.
# #
if [ $USE_IO == yes -a $IO_PRESENT == yes ] if [ $USE_IO = yes -a $IO_PRESENT = yes ]
then then
if px4io start if px4io start
then then

View File

@ -7,7 +7,7 @@
set VEHICLE_TYPE mc set VEHICLE_TYPE mc
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set NAV_ACC_RAD 2.0 param set NAV_ACC_RAD 2.0

View File

@ -218,7 +218,7 @@ then
# external LSM303D is rotated 270 degrees yaw # external LSM303D is rotated 270 degrees yaw
lsm303d -X -R 6 start lsm303d -X -R 6 start
if [ $BOARD_FMUV3 == 20 ] if [ $BOARD_FMUV3 = 20 ]
then then
# v2.0 internal MPU6000 is rotated 180 deg roll, 270 deg yaw # v2.0 internal MPU6000 is rotated 180 deg roll, 270 deg yaw
mpu6000 -R 14 start mpu6000 -R 14 start
@ -227,14 +227,14 @@ then
hmc5883 -C -T -S -R 8 start hmc5883 -C -T -S -R 8 start
fi fi
if [ $BOARD_FMUV3 == 21 ] if [ $BOARD_FMUV3 = 21 ]
then then
# v2.1 internal MPU9250 is rotated 180 deg roll, 270 deg yaw # v2.1 internal MPU9250 is rotated 180 deg roll, 270 deg yaw
mpu9250 -R 14 start mpu9250 -R 14 start
fi fi
else else
# $BOARD_FMUV3 == 0 -> FMUv2 # $BOARD_FMUV3 = 0 -> FMUv2
mpu6000 start mpu6000 start
@ -364,7 +364,7 @@ fi
# Begin Optional drivers # # Begin Optional drivers #
############################################################################### ###############################################################################
if [ ${VEHICLE_TYPE} == fw -o ${VEHICLE_TYPE} == vtol ] if [ ${VEHICLE_TYPE} = fw -o ${VEHICLE_TYPE} = vtol ]
then then
if param compare CBRK_AIRSPD_CHK 0 if param compare CBRK_AIRSPD_CHK 0
then then
@ -374,7 +374,7 @@ then
# detected as MS5525 because the chip manufacturer was so # detected as MS5525 because the chip manufacturer was so
# clever to assign the same I2C address and skip a WHO_AM_I # clever to assign the same I2C address and skip a WHO_AM_I
# register. # register.
if [ $BOARD_FMUV3 == 21 ] if [ $BOARD_FMUV3 = 21 ]
then then
ms5525_airspeed start -b 2 ms5525_airspeed start -b 2
else else

View File

@ -7,7 +7,7 @@
set VEHICLE_TYPE ugv set VEHICLE_TYPE ugv
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
# #
# Default parameters for UGVs. # Default parameters for UGVs.

View File

@ -8,15 +8,15 @@
# #
# Fixed wing setup. # Fixed wing setup.
# #
if [ $VEHICLE_TYPE == fw ] if [ $VEHICLE_TYPE = fw ]
then then
if [ $MIXER == none ] if [ $MIXER = none ]
then then
# Set default mixer for fixed wing if not defined. # Set default mixer for fixed wing if not defined.
set MIXER AERT set MIXER AERT
fi fi
if [ $MAV_TYPE == none ] if [ $MAV_TYPE = none ]
then then
# Set a default MAV_TYPE = 1 if not defined. # Set a default MAV_TYPE = 1 if not defined.
set MAV_TYPE 1 set MAV_TYPE 1
@ -35,40 +35,40 @@ fi
# #
# Multicopter setup. # Multicopter setup.
# #
if [ $VEHICLE_TYPE == mc ] if [ $VEHICLE_TYPE = mc ]
then then
if [ $MIXER == none ] if [ $MIXER = none ]
then then
echo "MC mixer undefined" echo "MC mixer undefined"
fi fi
if [ $MAV_TYPE == none ] if [ $MAV_TYPE = none ]
then then
# Set a default MAV_TYPE = 2 if not defined. # Set a default MAV_TYPE = 2 if not defined.
set MAV_TYPE 2 set MAV_TYPE 2
# Use mixer to detect vehicle type # Use mixer to detect vehicle type
if [ $MIXER == coax ] if [ $MIXER = coax ]
then then
set MAV_TYPE 3 set MAV_TYPE 3
fi fi
if [ $MIXER == hexa_x -o $MIXER == hexa_+ ] if [ $MIXER = hexa_x -o $MIXER = hexa_+ ]
then then
set MAV_TYPE 13 set MAV_TYPE 13
fi fi
if [ $MIXER == hexa_cox ] if [ $MIXER = hexa_cox ]
then then
set MAV_TYPE 13 set MAV_TYPE 13
fi fi
if [ $MIXER == octo_x -o $MIXER == octo_+ ] if [ $MIXER = octo_x -o $MIXER = octo_+ ]
then then
set MAV_TYPE 14 set MAV_TYPE 14
fi fi
if [ $MIXER == octo_cox -o $MIXER == octo_cox_w ] if [ $MIXER = octo_cox -o $MIXER = octo_cox_w ]
then then
set MAV_TYPE 14 set MAV_TYPE 14
fi fi
if [ $MIXER == tri_y_yaw- -o $MIXER == tri_y_yaw+ ] if [ $MIXER = tri_y_yaw- -o $MIXER = tri_y_yaw+ ]
then then
set MAV_TYPE 15 set MAV_TYPE 15
fi fi
@ -87,15 +87,15 @@ fi
# #
# UGV setup. # UGV setup.
# #
if [ $VEHICLE_TYPE == ugv ] if [ $VEHICLE_TYPE = ugv ]
then then
if [ $MIXER == none ] if [ $MIXER = none ]
then then
# Set default mixer for UGV if not defined. # Set default mixer for UGV if not defined.
set MIXER ugv_generic set MIXER ugv_generic
fi fi
if [ $MAV_TYPE == none ] if [ $MAV_TYPE = none ]
then then
# Set a default MAV_TYPE = 10 if not defined. # Set a default MAV_TYPE = 10 if not defined.
set MAV_TYPE 10 set MAV_TYPE 10
@ -114,24 +114,24 @@ fi
# #
# VTOL setup. # VTOL setup.
# #
if [ $VEHICLE_TYPE == vtol ] if [ $VEHICLE_TYPE = vtol ]
then then
if [ $MIXER == none ] if [ $MIXER = none ]
then then
echo "VTOL mixer undefined" echo "VTOL mixer undefined"
fi fi
if [ $MAV_TYPE == none ] if [ $MAV_TYPE = none ]
then then
# Set a default MAV_TYPE = 19 if not defined. # Set a default MAV_TYPE = 19 if not defined.
set MAV_TYPE 19 set MAV_TYPE 19
# Use mixer to detect vehicle type. # Use mixer to detect vehicle type.
if [ $MIXER == firefly6 ] if [ $MIXER = firefly6 ]
then then
set MAV_TYPE 21 set MAV_TYPE 21
fi fi
if [ $MIXER == quad_x_pusher_vtol ] if [ $MIXER = quad_x_pusher_vtol ]
then then
set MAV_TYPE 22 set MAV_TYPE 22
fi fi
@ -150,7 +150,7 @@ fi
# #
# Generic setup (autostart ID not found). # Generic setup (autostart ID not found).
# #
if [ $VEHICLE_TYPE == none ] if [ $VEHICLE_TYPE = none ]
then then
echo "No autostart ID found" echo "No autostart ID found"
ekf2 start ekf2 start

View File

@ -7,7 +7,7 @@
set VEHICLE_TYPE vtol set VEHICLE_TYPE vtol
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MIS_TAKEOFF_ALT 20 param set MIS_TAKEOFF_ALT 20
param set MIS_YAW_TMT 10 param set MIS_YAW_TMT 10

View File

@ -163,7 +163,7 @@ fi
if ! ver hwcmp CRAZYFLIE AEROCORE2 if ! ver hwcmp CRAZYFLIE AEROCORE2
then then
# Run no SD alarm. # Run no SD alarm.
if [ $LOG_FILE == /dev/null ] if [ $LOG_FILE = /dev/null ]
then then
# tune Make FS MBAGP # tune Make FS MBAGP
tune_control play -t 2 tune_control play -t 2
@ -335,7 +335,7 @@ else
# #
# If autoconfig parameter was set, reset it and save parameters. # If autoconfig parameter was set, reset it and save parameters.
# #
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
# Run FMU as task on Pixracer and on boards with enough RAM. # Run FMU as task on Pixracer and on boards with enough RAM.
if ver hwcmp PX4FMU_V4 PX4FMU_V4PRO PX4FMU_V5 if ver hwcmp PX4FMU_V4 PX4FMU_V4PRO PX4FMU_V5
@ -406,7 +406,7 @@ else
fi fi
fi fi
if [ $IO_PRESENT == no ] if [ $IO_PRESENT = no ]
then then
echo "PX4IO update failed" >> $LOG_FILE echo "PX4IO update failed" >> $LOG_FILE
# Error tune. # Error tune.
@ -424,14 +424,14 @@ else
set USE_IO yes set USE_IO yes
fi fi
if [ $USE_IO == yes -a $IO_PRESENT == no ] if [ $USE_IO = yes -a $IO_PRESENT = no ]
then then
echo "PX4IO not found" >> $LOG_FILE echo "PX4IO not found" >> $LOG_FILE
# Error tune. # Error tune.
tune_control play -t 2 tune_control play -t 2
fi fi
if [ $IO_PRESENT == no -o $USE_IO == no ] if [ $IO_PRESENT = no -o $USE_IO = no ]
then then
rc_input start rc_input start
fi fi

View File

@ -46,7 +46,7 @@ then
set BOARD_FMUV3 false set BOARD_FMUV3 false
fi fi
if [ $BOARD_FMUV3 == true ] if [ $BOARD_FMUV3 = true ]
then then
# external L3GD20H is rotated 180 degrees yaw # external L3GD20H is rotated 180 degrees yaw
if l3gd20 -X -R 4 start if l3gd20 -X -R 4 start

View File

@ -24,7 +24,7 @@ fi
# Try to mount the microSD card. # Try to mount the microSD card.
# #
mount -t vfat /dev/mmcsd0 /fs/microsd mount -t vfat /dev/mmcsd0 /fs/microsd
if [ $? == 0 ] if [ $? = 0 ]
then then
echo "[i] card mounted at /fs/microsd" echo "[i] card mounted at /fs/microsd"
# Start playing the startup tune # Start playing the startup tune

View File

@ -2,7 +2,7 @@
set VEHICLE_TYPE fw set VEHICLE_TYPE fw
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
# #
# Default parameters for FW # Default parameters for FW

View File

@ -16,7 +16,7 @@ then
set OUTPUT_DEV /dev/pwm_output0 set OUTPUT_DEV /dev/pwm_output0
if [ $OUTPUT_MODE == tap_esc ] if [ $OUTPUT_MODE = tap_esc ]
then then
set OUTPUT_DEV /dev/tap_esc set OUTPUT_DEV /dev/tap_esc
fi fi
@ -40,7 +40,7 @@ else
fi fi
fi fi
if [ $OUTPUT_MODE == fmu -o $OUTPUT_MODE == io ] if [ $OUTPUT_MODE = fmu -o $OUTPUT_MODE = io ]
then then
if [ $PWM_OUT != none ] if [ $PWM_OUT != none ]
then then

View File

@ -2,7 +2,7 @@
set VEHICLE_TYPE mc set VEHICLE_TYPE mc
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set PWM_DISARMED 900 param set PWM_DISARMED 900
param set PWM_MIN 1075 param set PWM_MIN 1075

View File

@ -2,7 +2,7 @@
set VEHICLE_TYPE vtol set VEHICLE_TYPE vtol
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set MC_ROLL_P 6.0 param set MC_ROLL_P 6.0
param set MC_PITCH_P 6.0 param set MC_PITCH_P 6.0

View File

@ -125,7 +125,7 @@ sh /etc/init.d/rc.autostart
# #
# If autoconfig parameter was set, reset it and save parameters # If autoconfig parameter was set, reset it and save parameters
# #
if [ $AUTOCNF == yes ] if [ $AUTOCNF = yes ]
then then
param set SYS_AUTOCONFIG 0 param set SYS_AUTOCONFIG 0
param save param save
@ -135,9 +135,9 @@ unset AUTOCNF
# #
# Set default output if not set # Set default output if not set
# #
if [ $OUTPUT_MODE == none ] if [ $OUTPUT_MODE = none ]
then then
if [ $USE_IO == yes ] if [ $USE_IO = yes ]
then then
set OUTPUT_MODE io set OUTPUT_MODE io
else else
@ -181,17 +181,17 @@ mavlink start -r 60000 -d /dev/ttyACM0 -m config
# #
# Fixed wing setup # Fixed wing setup
# #
if [ $VEHICLE_TYPE == fw ] if [ $VEHICLE_TYPE = fw ]
then then
echo "INFO [init] Fixedwing" echo "INFO [init] Fixedwing"
if [ $MIXER == none ] if [ $MIXER = none ]
then then
# Set default mixer for fixed wing if not defined # Set default mixer for fixed wing if not defined
set MIXER AERT set MIXER AERT
fi fi
if [ $MAV_TYPE == none ] if [ $MAV_TYPE = none ]
then then
# Use MAV_TYPE = 1 (fixed wing) if not defined # Use MAV_TYPE = 1 (fixed wing) if not defined
set MAV_TYPE 1 set MAV_TYPE 1
@ -209,50 +209,50 @@ fi
# #
# Multicopters setup # Multicopters setup
# #
if [ $VEHICLE_TYPE == mc ] if [ $VEHICLE_TYPE = mc ]
then then
echo "INFO [init] Multicopter" echo "INFO [init] Multicopter"
if [ $MIXER == none ] if [ $MIXER = none ]
then then
echo "INFO [init] Mixer undefined" echo "INFO [init] Mixer undefined"
fi fi
if [ $MAV_TYPE == none ] if [ $MAV_TYPE = none ]
then then
# Use mixer to detect vehicle type # Use mixer to detect vehicle type
if [ $MIXER == quad_x -o $MIXER == quad_+ ] if [ $MIXER = quad_x -o $MIXER = quad_+ ]
then then
set MAV_TYPE 2 set MAV_TYPE 2
fi fi
if [ $MIXER == quad_w ] if [ $MIXER = quad_w ]
then then
set MAV_TYPE 2 set MAV_TYPE 2
fi fi
if [ $MIXER == quad_h ] if [ $MIXER = quad_h ]
then then
set MAV_TYPE 2 set MAV_TYPE 2
fi fi
if [ $MIXER == tri_y_yaw- -o $MIXER == tri_y_yaw+ ] if [ $MIXER = tri_y_yaw- -o $MIXER = tri_y_yaw+ ]
then then
set MAV_TYPE 15 set MAV_TYPE 15
fi fi
if [ $MIXER == hexa_x -o $MIXER == hexa_+ ] if [ $MIXER = hexa_x -o $MIXER = hexa_+ ]
then then
set MAV_TYPE 13 set MAV_TYPE 13
fi fi
if [ $MIXER == hexa_cox ] if [ $MIXER = hexa_cox ]
then then
set MAV_TYPE 13 set MAV_TYPE 13
fi fi
if [ $MIXER == octo_x -o $MIXER == octo_+ ] if [ $MIXER = octo_x -o $MIXER = octo_+ ]
then then
set MAV_TYPE 14 set MAV_TYPE 14
fi fi
fi fi
# Still no MAV_TYPE found # Still no MAV_TYPE found
if [ $MAV_TYPE == none ] if [ $MAV_TYPE = none ]
then then
echo "WARN [init] Unknown MAV_TYPE" echo "WARN [init] Unknown MAV_TYPE"
param set MAV_TYPE 2 param set MAV_TYPE 2
@ -270,34 +270,34 @@ fi
# #
# VTOL setup # VTOL setup
# #
if [ $VEHICLE_TYPE == vtol ] if [ $VEHICLE_TYPE = vtol ]
then then
echo "INFO [init] VTOL" echo "INFO [init] VTOL"
if [ $MIXER == none ] if [ $MIXER = none ]
then then
echo "WARN [init] VTOL mixer undefined" echo "WARN [init] VTOL mixer undefined"
fi fi
if [ $MAV_TYPE == none ] if [ $MAV_TYPE = none ]
then then
# Use mixer to detect vehicle type # Use mixer to detect vehicle type
if [ $MIXER == caipirinha_vtol ] if [ $MIXER = caipirinha_vtol ]
then then
set MAV_TYPE 19 set MAV_TYPE 19
fi fi
if [ $MIXER == firefly6 ] if [ $MIXER = firefly6 ]
then then
set MAV_TYPE 21 set MAV_TYPE 21
fi fi
if [ $MIXER == quad_x_pusher_vtol ] if [ $MIXER = quad_x_pusher_vtol ]
then then
set MAV_TYPE 22 set MAV_TYPE 22
fi fi
fi fi
# Still no MAV_TYPE found # Still no MAV_TYPE found
if [ $MAV_TYPE == none ] if [ $MAV_TYPE = none ]
then then
echo "WARN [init] Unknown MAV_TYPE" echo "WARN [init] Unknown MAV_TYPE"
param set MAV_TYPE 19 param set MAV_TYPE 19
@ -315,7 +315,7 @@ fi
# #
# UGV/Rover setup # UGV/Rover setup
# #
if [ $VEHICLE_TYPE == ugv ] if [ $VEHICLE_TYPE = ugv ]
then then
# 10 is MAV_TYPE_GROUND_ROVER # 10 is MAV_TYPE_GROUND_ROVER
set MAV_TYPE 10 set MAV_TYPE 10

View File

@ -6,7 +6,7 @@ set SERIAL_DEV none
{% for serial_device in serial_devices -%} {% for serial_device in serial_devices -%}
if param compare "$PRT" {{ serial_device.index }} if param compare "$PRT" {{ serial_device.index }}
then then
if [ "x$PRT_{{ serial_device.tag }}_" == "x" ] if [ "x$PRT_{{ serial_device.tag }}_" = "x" ]
then then
set SERIAL_DEV {{ serial_device.device }} set SERIAL_DEV {{ serial_device.device }}
set BAUD_PARAM SER_{{ serial_device.tag }}_BAUD set BAUD_PARAM SER_{{ serial_device.tag }}_BAUD