From 619b1ecd474937ffc3eee97076086dc89d9975da Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 7 Sep 2023 20:13:30 +1000 Subject: [PATCH] ArduCopter: support preflight calibration via command_int --- ArduCopter/GCS_Mavlink.cpp | 4 ++-- ArduCopter/GCS_Mavlink.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index 7ca40bbb32..b73e6c2f1d 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -653,9 +653,9 @@ void GCS_MAVLINK_Copter::handle_landing_target(const mavlink_landing_target_t &p #endif } -MAV_RESULT GCS_MAVLINK_Copter::_handle_command_preflight_calibration(const mavlink_command_long_t &packet, const mavlink_message_t &msg) +MAV_RESULT GCS_MAVLINK_Copter::_handle_command_preflight_calibration(const mavlink_command_int_t &packet, const mavlink_message_t &msg) { - if (is_equal(packet.param6,1.0f)) { + if (packet.y == 1) { // compassmot calibration return copter.mavlink_compassmot(*this); } diff --git a/ArduCopter/GCS_Mavlink.h b/ArduCopter/GCS_Mavlink.h index 2c0be3b05e..9201d9f657 100644 --- a/ArduCopter/GCS_Mavlink.h +++ b/ArduCopter/GCS_Mavlink.h @@ -26,7 +26,7 @@ protected: bool params_ready() const override; void send_banner() override; - MAV_RESULT _handle_command_preflight_calibration(const mavlink_command_long_t &packet, const mavlink_message_t &msg) override; + MAV_RESULT _handle_command_preflight_calibration(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override; void send_attitude_target() override; void send_position_target_global_int() override;