From f688ceb06162e68d33ca9a93bbd7519a145ac922 Mon Sep 17 00:00:00 2001 From: muramura Date: Wed, 29 May 2024 00:21:28 +0900 Subject: [PATCH] GCS_MAVLink: Remove any unnecessary processing --- libraries/GCS_MAVLink/GCS_Param.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS_Param.cpp b/libraries/GCS_MAVLink/GCS_Param.cpp index fe6ab7c11b357..ae3f4a6b61eeb 100644 --- a/libraries/GCS_MAVLink/GCS_Param.cpp +++ b/libraries/GCS_MAVLink/GCS_Param.cpp @@ -131,14 +131,13 @@ void GCS_MAVLINK::handle_request_data_stream(const mavlink_message_t &msg) mavlink_request_data_stream_t packet; mavlink_msg_request_data_stream_decode(&msg, &packet); - int16_t freq = 0; // packet frequency + int16_t freq = 0; // stop sending - if (packet.start_stop == 0) - freq = 0; // stop sending - else if (packet.start_stop == 1) + if (packet.start_stop == 1) { freq = packet.req_message_rate; // start sending - else + } else if (packet.start_stop > 1) { return; + } // if stream_id is still NUM_STREAMS at the end of this switch // block then either we set stream rates for all streams, or we