aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_common
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-03-19 20:01:01 +0400
committerAnton Babushkin <anton.babushkin@me.com>2014-03-19 20:01:01 +0400
commit9b71e660ad86cb2ecec4db93795f417a9ba0fddd (patch)
treec7bd62f4e4b260f03c6103e9d322e2b3f84d11c2 /ROMFS/px4fmu_common
parent068b7526b74c9bbcc31acc28f0d578ed9c0f97b1 (diff)
parent295f87f22cc471fccb44e3f3dee3e8fcab263de2 (diff)
downloadpx4-firmware-9b71e660ad86cb2ecec4db93795f417a9ba0fddd.tar.gz
px4-firmware-9b71e660ad86cb2ecec4db93795f417a9ba0fddd.tar.bz2
px4-firmware-9b71e660ad86cb2ecec4db93795f417a9ba0fddd.zip
Merge branch 'beta_mavlink2' into mpc_local_pos_mavlink
Diffstat (limited to 'ROMFS/px4fmu_common')
-rw-r--r--ROMFS/px4fmu_common/init.d/rc.usb33
-rw-r--r--ROMFS/px4fmu_common/init.d/rcS39
2 files changed, 25 insertions, 47 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rc.usb b/ROMFS/px4fmu_common/init.d/rc.usb
index 0cd8a0e04..558be4275 100644
--- a/ROMFS/px4fmu_common/init.d/rc.usb
+++ b/ROMFS/px4fmu_common/init.d/rc.usb
@@ -5,38 +5,7 @@
echo "Starting MAVLink on this USB console"
-# Stop tone alarm
-tone_alarm stop
-
-#
-# Check for UORB
-#
-if uorb start
-then
- echo "uORB started"
-fi
-
-# Tell MAVLink that this link is "fast"
-if mavlink stop
-then
- echo "stopped other MAVLink instance"
-fi
-mavlink start -b 230400 -d /dev/ttyACM0
-
-# Stop commander
-if commander stop
-then
- echo "Commander stopped"
-fi
-sleep 1
-
-# Start the commander
-if commander start
-then
- echo "Commander started"
-fi
-
-echo "MAVLink started, exiting shell.."
+mavlink start -r 10000 -d /dev/ttyACM0
# Exit shell to make it available to MAVLink
exit
diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS
index 7c3524fef..7797feb74 100644
--- a/ROMFS/px4fmu_common/init.d/rcS
+++ b/ROMFS/px4fmu_common/init.d/rcS
@@ -117,6 +117,8 @@ then
set PWM_MAX none
set MKBLCTRL_MODE none
set FMU_MODE pwm
+ set MAVLINK_FLAGS default
+ set EXIT_ON_END no
set MAV_TYPE none
set LOAD_DEFAULT_APPS yes
@@ -385,28 +387,34 @@ then
#
# MAVLink
#
- set EXIT_ON_END no
- if [ $HIL == yes ]
+ if [ $MAVLINK_FLAGS == default ]
then
- sleep 1
- mavlink start -b 230400 -d /dev/ttyACM0
- usleep 5000
- else
- if [ $TTYS1_BUSY == yes ]
+ if [ $HIL == yes ]
then
- # Start MAVLink on ttyS0, because FMU ttyS1 pins configured as something else
- mavlink start -d /dev/ttyS0
+ sleep 1
+ set MAVLINK_FLAGS "-r 10000 -d /dev/ttyACM0"
usleep 5000
-
- # Exit from nsh to free port for mavlink
- set EXIT_ON_END yes
else
- # Start MAVLink on default port: ttyS1
- mavlink start
- usleep 5000
+ # Normal mode, use baudrate 57600 (default) and data rate 1000 bytes/s
+ if [ $TTYS1_BUSY == yes ]
+ then
+ # Start MAVLink on ttyS0, because FMU ttyS1 pins configured as something else
+ set MAVLINK_FLAGS "-r 1000 -d /dev/ttyS0"
+ usleep 5000
+
+ # Exit from nsh to free port for mavlink
+ set EXIT_ON_END yes
+ else
+ # Start MAVLink on default port: ttyS1
+ set MAVLINK_FLAGS "-r 1000"
+ usleep 5000
+ fi
fi
fi
+
+ mavlink start $MAVLINK_FLAGS
+ usleep 5000
#
# Start the datamanager
@@ -551,6 +559,7 @@ then
if [ $EXIT_ON_END == yes ]
then
+ echo "[init] Exit from nsh"
exit
fi