diff --git a/ArduPlane/Plane.h b/ArduPlane/Plane.h index 3aaf0cc336..090c097d1e 100644 --- a/ArduPlane/Plane.h +++ b/ArduPlane/Plane.h @@ -84,6 +84,7 @@ #include <AP_BoardConfig/AP_BoardConfig.h> #include <AP_BoardConfig/AP_BoardConfig_CAN.h> #include <AP_Frsky_Telem/AP_Frsky_Telem.h> +#include <AP_Devo_Telem/AP_Devo_Telem.h> #include <AP_ServoRelayEvents/AP_ServoRelayEvents.h> #include <AP_Rally/AP_Rally.h> @@ -390,6 +391,10 @@ private: // FrSky telemetry support AP_Frsky_Telem frsky_telemetry{ahrs, battery, rangefinder}; #endif +#if DEVO_TELEM_ENABLED == ENABLED + // DEVO-M telemetry support + AP_DEVO_Telem devo_telemetry {ahrs}; +#endif // Variables for extended status MAVLink messages uint32_t control_sensors_present; diff --git a/ArduPlane/config.h b/ArduPlane/config.h index 508b06d5d1..e05a179b14 100644 --- a/ArduPlane/config.h +++ b/ArduPlane/config.h @@ -365,3 +365,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/ArduPlane/make.inc b/ArduPlane/make.inc index aaf6887679..fd7cb4dcd8 100644 --- a/ArduPlane/make.inc +++ b/ArduPlane/make.inc @@ -60,3 +60,4 @@ LIBRARIES += AP_Beacon LIBRARIES += PID LIBRARIES += AP_Soaring LIBRARIES += AP_Gripper +LIBRARIES += AP_Devo_Telem diff --git a/ArduPlane/system.cpp b/ArduPlane/system.cpp index c0a6422a65..c0bc77776f 100644 --- a/ArduPlane/system.cpp +++ b/ArduPlane/system.cpp @@ -119,6 +119,9 @@ void Plane::init_ardupilot() frsky_telemetry.init(serial_manager, fwver.fw_string, MAV_TYPE_FIXED_WING); #endif +#if DEVO_TELEM_ENABLED == ENABLED + devo_telemetry.init(serial_manager); +#endif #if LOGGING_ENABLED == ENABLED log_init(); @@ -301,6 +304,10 @@ void Plane::set_mode(enum FlightMode mode, mode_reason_t reason) #if FRSKY_TELEM_ENABLED == ENABLED frsky_telemetry.update_control_mode(control_mode); #endif +#if DEVO_TELEM_ENABLED == ENABLED + devo_telemetry.update_control_mode(control_mode); +#endif + #if CAMERA == ENABLED camera.set_is_auto_mode(control_mode == AUTO); #endif diff --git a/ArduPlane/wscript b/ArduPlane/wscript index 2aa8e70358..45c36f022a 100644 --- a/ArduPlane/wscript +++ b/ArduPlane/wscript @@ -32,7 +32,8 @@ def build(bld): 'AP_Beacon', 'PID', 'AP_Soaring', - 'AP_Gripper' + 'AP_Gripper', + 'AP_Devo_Telem', ], )