From acaf7cd267fe8ef49b64a3c3acc3e51a0d4743eb Mon Sep 17 00:00:00 2001 From: ChristophTobler Date: Wed, 31 Jan 2018 09:14:34 +0100 Subject: [PATCH] rcS: automate tfmini start disable mavlink on aero telemetry if tfmini enabled and start on mavlink companion device for others (needs SYS_COMPANION to be 0) --- ROMFS/px4fmu_common/init.d/rc.sensors | 12 ++++++++++++ ROMFS/px4fmu_common/init.d/rcS | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors index 38b1b4662a..e9187a8bc8 100644 --- a/ROMFS/px4fmu_common/init.d/rc.sensors +++ b/ROMFS/px4fmu_common/init.d/rc.sensors @@ -400,6 +400,18 @@ then then # start the driver on serial 4/5 tfmini start -d /dev/ttyS6 + else + if ver hwcmp AEROFC_V1 + then + # start the driver on telemetry + tfmini start -d /dev/ttyS3 + else + if param compare SYS_COMPANION 0 + then + # start on default mavlink companion device + tfmini start -d /dev/ttyS2 + fi + fi fi fi diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 58403fd88e..0c1539df9b 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -554,7 +554,13 @@ then if ver hwcmp AEROFC_V1 then - set MAVLINK_F "-r 1200 -d /dev/ttyS3" + # Only start mavlink if the Benewake TFMini isn't being used + if param greater SENS_EN_TFMINI 0 + then + set MAVLINK_F none + else + set MAVLINK_F "-r 1200 -d /dev/ttyS3" + fi fi if ver hwcmp CRAZYFLIE