From 2aee8d1018642ec24e3b2c569f1cdcf6dd001bd7 Mon Sep 17 00:00:00 2001 From: night-ghost Date: Sun, 4 Mar 2018 14:41:06 +0500 Subject: [PATCH] APMrover2: devo telemetry support (RX705/707) --- APMrover2/Rover.h | 4 ++++ APMrover2/config.h | 8 ++++++++ APMrover2/make.inc | 1 + APMrover2/system.cpp | 7 +++++++ APMrover2/wscript | 1 + 5 files changed, 21 insertions(+) diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index 91c17492f6..79a275582a 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -40,6 +40,7 @@ #include // ArduPilot Mega Magnetometer Library #include // Compass declination library #include +#include #include // ArduPilot GPS library #include // Inertial Sensor (uncalibated IMU) Library #include @@ -296,6 +297,9 @@ private: // FrSky telemetry support AP_Frsky_Telem frsky_telemetry{ahrs, battery, rangefinder}; #endif +#if DEVO_TELEM_ENABLED == ENABLED + AP_DEVO_Telem devo_telemetry{ahrs}; +#endif uint32_t control_sensors_present; uint32_t control_sensors_enabled; diff --git a/APMrover2/config.h b/APMrover2/config.h index f45016bbaa..53c96af2d6 100644 --- a/APMrover2/config.h +++ b/APMrover2/config.h @@ -177,3 +177,11 @@ #ifndef STATS_ENABLED # define STATS_ENABLED ENABLED #endif + +#ifndef DEVO_TELEM_ENABLED +#if HAL_MINIMIZE_FEATURES + #define DEVO_TELEM_ENABLED DISABLED +#else + #define DEVO_TELEM_ENABLED ENABLED +#endif +#endif diff --git a/APMrover2/make.inc b/APMrover2/make.inc index b9701796f0..99a6be9bd7 100644 --- a/APMrover2/make.inc +++ b/APMrover2/make.inc @@ -51,3 +51,4 @@ LIBRARIES += AC_Fence LIBRARIES += AP_SmartRTL LIBRARIES += AC_Avoidance LIBRARIES += AC_AttitudeControl +LIBRARIES += AP_Devo_Telem diff --git a/APMrover2/system.cpp b/APMrover2/system.cpp index 5d81bdfb80..b3c91d0cfc 100644 --- a/APMrover2/system.cpp +++ b/APMrover2/system.cpp @@ -82,6 +82,9 @@ void Rover::init_ardupilot() #if FRSKY_TELEM_ENABLED == ENABLED frsky_telemetry.init(serial_manager, fwver.fw_string, (is_boat() ? MAV_TYPE_SURFACE_BOAT : MAV_TYPE_GROUND_ROVER)); #endif +#if DEVO_TELEM_ENABLED == ENABLED + devo_telemetry.init(serial_manager); +#endif #if LOGGING_ENABLED == ENABLED log_init(); @@ -235,6 +238,10 @@ bool Rover::set_mode(Mode &new_mode, mode_reason_t reason) #if FRSKY_TELEM_ENABLED == ENABLED frsky_telemetry.update_control_mode(control_mode->mode_number()); #endif +#if DEVO_TELEM_ENABLED == ENABLED + devo_telemetry.update_control_mode(control_mode->mode_number()); +#endif + #if CAMERA == ENABLED camera.set_is_auto_mode(control_mode->mode_number() == AUTO); #endif diff --git a/APMrover2/wscript b/APMrover2/wscript index a65432691b..c1c7bb8589 100644 --- a/APMrover2/wscript +++ b/APMrover2/wscript @@ -25,6 +25,7 @@ def build(bld): 'AP_Proximity', 'AC_Avoidance', 'AC_AttitudeControl', + 'AP_Devo_Telem', ], )