diff --git a/ArduCopter/ArduCopter.cpp b/ArduCopter/ArduCopter.cpp index 9914d9cf48..f05db99bf3 100644 --- a/ArduCopter/ArduCopter.cpp +++ b/ArduCopter/ArduCopter.cpp @@ -339,7 +339,7 @@ void Copter::update_trigger(void) #if CAMERA == ENABLED camera.trigger_pic_cleanup(); if (camera.check_trigger_pin()) { - gcs_send_message(MSG_CAMERA_FEEDBACK); + gcs().send_message(MSG_CAMERA_FEEDBACK); if (should_log(MASK_LOG_CAMERA)) { DataFlash.Log_Write_Camera(ahrs, gps, current_loc); } @@ -416,7 +416,7 @@ void Copter::twentyfive_hz_logging() { #if HIL_MODE != HIL_MODE_DISABLED // HIL for a copter needs very fast update of the servo values - gcs_send_message(MSG_SERVO_OUTPUT_RAW); + gcs().send_message(MSG_SERVO_OUTPUT_RAW); #endif #if HIL_MODE == HIL_MODE_DISABLED diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index eea8bd25ca..4293e78fee 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -718,7 +718,6 @@ private: void init_visual_odom(); void update_visual_odom(); void send_pid_tuning(mavlink_channel_t chan); - void gcs_send_message(enum ap_message id); void gcs_send_mission_item_reached_message(uint16_t mission_index); void gcs_data_stream_send(void); void gcs_check_input(void); diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index 6a95ce0848..1ad0928b9a 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -5,12 +5,12 @@ void Copter::gcs_send_heartbeat(void) { - gcs_send_message(MSG_HEARTBEAT); + gcs().send_message(MSG_HEARTBEAT); } void Copter::gcs_send_deferred(void) { - gcs_send_message(MSG_RETRY_DEFERRED); + gcs().send_message(MSG_RETRY_DEFERRED); gcs().service_statustext(); } @@ -2027,7 +2027,7 @@ void Copter::mavlink_delay_cb() if (tnow - last_1hz > 1000) { last_1hz = tnow; gcs_send_heartbeat(); - gcs_send_message(MSG_EXTENDED_STATUS1); + gcs().send_message(MSG_EXTENDED_STATUS1); } if (tnow - last_50hz > 20) { last_50hz = tnow; @@ -2046,14 +2046,6 @@ void Copter::mavlink_delay_cb() in_mavlink_delay = false; } -/* - * send a message on both GCS links - */ -void Copter::gcs_send_message(enum ap_message id) -{ - gcs().send_message(id); -} - /* * send a mission item reached message and load the index before the send attempt in case it may get delayed */ diff --git a/ArduCopter/commands_logic.cpp b/ArduCopter/commands_logic.cpp index cfcf0e3852..8d7e320f58 100644 --- a/ArduCopter/commands_logic.cpp +++ b/ArduCopter/commands_logic.cpp @@ -1155,7 +1155,7 @@ void Copter::do_take_picture() void Copter::log_picture() { if (!camera.using_feedback_pin()) { - gcs_send_message(MSG_CAMERA_FEEDBACK); + gcs().send_message(MSG_CAMERA_FEEDBACK); if (should_log(MASK_LOG_CAMERA)) { DataFlash.Log_Write_Camera(ahrs, gps, current_loc); }