Skip to content

Commit

Permalink
ArduCopter: move initialisation of serial and gcs to AP_Vehicle
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Feb 25, 2020
1 parent a6e1fce commit ae2578e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
5 changes: 5 additions & 0 deletions ArduCopter/GCS_Copter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

#include "Copter.h"

uint8_t GCS_Copter::sysid_this_mav() const
{
return copter.g.sysid_this_mav;
}

const char* GCS_Copter::frame_string() const
{
return copter.get_frame_string();
Expand Down
2 changes: 2 additions & 0 deletions ArduCopter/GCS_Copter.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class GCS_Copter : public GCS

protected:

uint8_t sysid_this_mav() const override;

// minimum amount of time (in microseconds) that must remain in
// the main scheduler loop before we are allowed to send any
// mavlink messages. We want to prioritise the main flight
Expand Down
11 changes: 0 additions & 11 deletions ArduCopter/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ void Copter::init_ardupilot()
g2.stats.init();
#endif

// identify ourselves correctly with the ground station
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();
Expand Down

0 comments on commit ae2578e

Please sign in to comment.