rcS: removed unnecessary sleeps, minor code style fixes

This commit is contained in:
Anton Babushkin
2014-03-31 10:10:50 +04:00
parent 9b1de5004c
commit 51e0ccb199
+3 -5
View File
@@ -294,6 +294,7 @@ then
tone_alarm $TUNE_OUT_ERROR tone_alarm $TUNE_OUT_ERROR
fi fi
fi fi
if [ $OUTPUT_MODE == fmu -o $OUTPUT_MODE == ardrone ] if [ $OUTPUT_MODE == fmu -o $OUTPUT_MODE == ardrone ]
then then
echo "[init] Use FMU as primary output" echo "[init] Use FMU as primary output"
@@ -317,6 +318,7 @@ then
fi fi
fi fi
fi fi
if [ $OUTPUT_MODE == mkblctrl ] if [ $OUTPUT_MODE == mkblctrl ]
then then
echo "[init] Use MKBLCTRL as primary output" echo "[init] Use MKBLCTRL as primary output"
@@ -339,6 +341,7 @@ then
fi fi
fi fi
if [ $OUTPUT_MODE == hil ] if [ $OUTPUT_MODE == hil ]
then then
echo "[init] Use HIL as primary output" echo "[init] Use HIL as primary output"
@@ -396,34 +399,29 @@ then
# #
# MAVLink # MAVLink
# #
if [ $MAVLINK_FLAGS == default ] if [ $MAVLINK_FLAGS == default ]
then then
if [ $HIL == yes ] if [ $HIL == yes ]
then then
sleep 1 sleep 1
set MAVLINK_FLAGS "-r 10000 -d /dev/ttyACM0" set MAVLINK_FLAGS "-r 10000 -d /dev/ttyACM0"
usleep 5000
else else
# Normal mode, use baudrate 57600 (default) and data rate 1000 bytes/s # Normal mode, use baudrate 57600 (default) and data rate 1000 bytes/s
if [ $TTYS1_BUSY == yes ] if [ $TTYS1_BUSY == yes ]
then then
# Start MAVLink on ttyS0, because FMU ttyS1 pins configured as something else # Start MAVLink on ttyS0, because FMU ttyS1 pins configured as something else
set MAVLINK_FLAGS "-r 1000 -d /dev/ttyS0" set MAVLINK_FLAGS "-r 1000 -d /dev/ttyS0"
usleep 5000
# Exit from nsh to free port for mavlink # Exit from nsh to free port for mavlink
set EXIT_ON_END yes set EXIT_ON_END yes
else else
# Start MAVLink on default port: ttyS1 # Start MAVLink on default port: ttyS1
set MAVLINK_FLAGS "-r 1000" set MAVLINK_FLAGS "-r 1000"
usleep 5000
fi fi
fi fi
fi fi
mavlink start $MAVLINK_FLAGS mavlink start $MAVLINK_FLAGS
usleep 5000
# #
# Start the datamanager # Start the datamanager