ArduCopter: move initialisation of serial and gcs to AP_Vehicle

This commit is contained in:
Peter Barker 2020-02-12 12:01:17 +11:00 committed by Andrew Tridgell
parent a6e1fce4bd
commit ae2578e5c9
3 changed files with 7 additions and 11 deletions

View File

@ -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();

View File

@ -39,6 +39,8 @@ public:
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

View File

@ -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();