mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-28 19:48:31 -04:00
Tracker: Support for a GCS singleton
This commit is contained in:
parent
14470573f6
commit
e12e51f502
@ -950,7 +950,7 @@ void Tracker::gcs_update(void)
|
||||
|
||||
void Tracker::gcs_send_text(MAV_SEVERITY severity, const char *str)
|
||||
{
|
||||
GCS_MAVLINK::send_statustext(severity, 0xFF, str);
|
||||
gcs().send_statustext(severity, 0xFF, str);
|
||||
notify.send_text(str);
|
||||
}
|
||||
|
||||
@ -966,7 +966,7 @@ void Tracker::gcs_send_text_fmt(MAV_SEVERITY severity, const char *fmt, ...)
|
||||
va_start(arg_list, fmt);
|
||||
hal.util->vsnprintf((char *)str, sizeof(str), fmt, arg_list);
|
||||
va_end(arg_list);
|
||||
GCS_MAVLINK::send_statustext(severity, 0xFF, str);
|
||||
gcs().send_statustext(severity, 0xFF, str);
|
||||
notify.send_text(str);
|
||||
}
|
||||
|
||||
@ -976,5 +976,5 @@ void Tracker::gcs_send_text_fmt(MAV_SEVERITY severity, const char *fmt, ...)
|
||||
void Tracker::gcs_retry_deferred(void)
|
||||
{
|
||||
gcs_send_message(MSG_RETRY_DEFERRED);
|
||||
GCS_MAVLINK::service_statustext();
|
||||
gcs().service_statustext();
|
||||
}
|
||||
|
@ -140,6 +140,8 @@ private:
|
||||
AP_SerialManager serial_manager;
|
||||
const uint8_t num_gcs = MAVLINK_COMM_NUM_BUFFERS;
|
||||
GCS_MAVLINK_Tracker gcs_chan[MAVLINK_COMM_NUM_BUFFERS];
|
||||
GCS _gcs; // avoid using this; use GCS::instance()
|
||||
GCS &gcs() { return _gcs; }
|
||||
|
||||
AP_BoardConfig BoardConfig;
|
||||
|
||||
|
@ -26,7 +26,7 @@ void Tracker::init_tracker()
|
||||
// Check the EEPROM format version before loading any parameters from EEPROM
|
||||
load_parameters();
|
||||
|
||||
GCS_MAVLINK::set_dataflash(&DataFlash);
|
||||
gcs().set_dataflash(&DataFlash);
|
||||
|
||||
mavlink_system.sysid = g.sysid_this_mav;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user