From 2f159288e2f675b5de985d8034ce4b121c95ec87 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 12 Feb 2020 12:01:17 +1100 Subject: [PATCH] AntennaTracker: move initialisation of serial and gcs to AP_Vehicle --- AntennaTracker/GCS_Tracker.cpp | 5 +++++ AntennaTracker/GCS_Tracker.h | 2 ++ AntennaTracker/system.cpp | 10 ---------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/AntennaTracker/GCS_Tracker.cpp b/AntennaTracker/GCS_Tracker.cpp index 55f93ff468..4c93f533a4 100644 --- a/AntennaTracker/GCS_Tracker.cpp +++ b/AntennaTracker/GCS_Tracker.cpp @@ -1,6 +1,11 @@ #include "GCS_Tracker.h" #include "Tracker.h" +uint8_t GCS_Tracker::sysid_this_mav() const +{ + return tracker.g.sysid_this_mav; +} + void GCS_Tracker::request_datastream_position(const uint8_t sysid, const uint8_t compid) { for (uint8_t i=0; i < num_gcs(); i++) { diff --git a/AntennaTracker/GCS_Tracker.h b/AntennaTracker/GCS_Tracker.h index 64f80159d9..e7494f7f0c 100644 --- a/AntennaTracker/GCS_Tracker.h +++ b/AntennaTracker/GCS_Tracker.h @@ -33,6 +33,8 @@ public: protected: + uint8_t sysid_this_mav() const override; + GCS_MAVLINK_Tracker *new_gcs_mavlink_backend(GCS_MAVLINK_Parameters ¶ms, AP_HAL::UARTDriver &uart) override { return new GCS_MAVLINK_Tracker(params, uart); diff --git a/AntennaTracker/system.cpp b/AntennaTracker/system.cpp index 7cbf79bbf0..9e650a7498 100644 --- a/AntennaTracker/system.cpp +++ b/AntennaTracker/system.cpp @@ -8,16 +8,6 @@ void Tracker::init_ardupilot() // initialise stats module stats.init(); - mavlink_system.sysid = g.sysid_this_mav; - - // initialise serial ports - serial_manager.init(); - - // setup first port early to allow BoardConfig to report errors - gcs().setup_console(); - - register_scheduler_delay_callback(); - BoardConfig.init(); #if HAL_WITH_UAVCAN BoardConfig_CAN.init();