From d8b7e4a199a1f6027260c1f60f9190dc1b69fa3c Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Fri, 15 May 2015 13:24:18 +0900 Subject: [PATCH] Copter: add support for 4th mavlink channel --- ArduCopter/Parameters.h | 1 + ArduCopter/Parameters.pde | 6 ++++++ ArduCopter/system.pde | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/ArduCopter/Parameters.h b/ArduCopter/Parameters.h index 7991659b75..a366b057bb 100644 --- a/ArduCopter/Parameters.h +++ b/ArduCopter/Parameters.h @@ -193,6 +193,7 @@ public: k_param_ch11_option, k_param_ch12_option, // 123 k_param_takeoff_trigger_dz, + k_param_gcs3, // 125 // // 140: Sensor parameters diff --git a/ArduCopter/Parameters.pde b/ArduCopter/Parameters.pde index 99542d4055..18e90015db 100644 --- a/ArduCopter/Parameters.pde +++ b/ArduCopter/Parameters.pde @@ -884,6 +884,12 @@ const AP_Param::Info var_info[] PROGMEM = { GOBJECTN(gcs[2], gcs2, "SR2_", GCS_MAVLINK), #endif +#if MAVLINK_COMM_NUM_BUFFERS > 3 + // @Group: SR3_ + // @Path: GCS_Mavlink.pde + GOBJECTN(gcs[3], gcs3, "SR3_", GCS_MAVLINK), +#endif + // @Group: AHRS_ // @Path: ../libraries/AP_AHRS/AP_AHRS.cpp GOBJECT(ahrs, "AHRS_", AP_AHRS), diff --git a/ArduCopter/system.pde b/ArduCopter/system.pde index f9b7842988..facbea5192 100644 --- a/ArduCopter/system.pde +++ b/ArduCopter/system.pde @@ -139,6 +139,11 @@ static void init_ardupilot() gcs[2].setup_uart(serial_manager, AP_SerialManager::SerialProtocol_MAVLink, 1); #endif +#if MAVLINK_COMM_NUM_BUFFERS > 3 + // setup serial port for fourth telemetry port (not used by default) + gcs[3].setup_uart(serial_manager, AP_SerialManager::SerialProtocol_MAVLink, 2); +#endif + #if FRSKY_TELEM_ENABLED == ENABLED // setup frsky frsky_telemetry.init(serial_manager);