From 778bff966c59e74b014064e913f72b823a8bbe11 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 26 Mar 2019 16:13:13 +1100 Subject: [PATCH] GCS_MAVLink: stop passing dataflash into handle_radio_status It can use the singleton instead --- libraries/GCS_MAVLink/GCS.h | 3 +-- libraries/GCS_MAVLink/GCS_Common.cpp | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index 7569d2c4a8..133e1fd46c 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -6,7 +6,6 @@ #include #include #include "GCS_MAVLink.h" -#include #include #include #include @@ -360,7 +359,7 @@ protected: virtual void handle_mount_message(const mavlink_message_t *msg); void handle_fence_message(mavlink_message_t *msg); void handle_param_value(mavlink_message_t *msg); - void handle_radio_status(mavlink_message_t *msg, AP_Logger &dataflash, bool log_radio); + void handle_radio_status(mavlink_message_t *msg, bool log_radio); void handle_serial_control(const mavlink_message_t *msg); void handle_vision_position_delta(mavlink_message_t *msg); diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index b6f2f33e72..31b6217f89 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -694,7 +695,7 @@ void GCS_MAVLINK::send_text(MAV_SEVERITY severity, const char *fmt, ...) va_end(arg_list); } -void GCS_MAVLINK::handle_radio_status(mavlink_message_t *msg, AP_Logger &dataflash, bool log_radio) +void GCS_MAVLINK::handle_radio_status(mavlink_message_t *msg, bool log_radio) { mavlink_radio_t packet; mavlink_msg_radio_decode(msg, &packet); @@ -730,7 +731,7 @@ void GCS_MAVLINK::handle_radio_status(mavlink_message_t *msg, AP_Logger &datafla //log rssi, noise, etc if logging Performance monitoring data if (log_radio) { - dataflash.Write_Radio(packet); + AP::logger().Write_Radio(packet); } }