From 8d970c13c035e8b88e015107378797c510487694 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 7 Dec 2018 10:44:01 +1100 Subject: [PATCH] GCS_MAVLink: avoid considering no_message_to_send equal to -1 --- libraries/GCS_MAVLink/GCS_Common.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index ccf174415d..8f82a46a06 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -1178,9 +1178,10 @@ void GCS_MAVLINK::update_send() } } - // check for any messages that the code has explicity sent - ap_message next = (ap_message)pushed_ap_message_ids.first_set(); - if (next != no_message_to_send) { + // check for any messages that the code has explicitly sent + const int16_t fs = pushed_ap_message_ids.first_set(); + if (fs != -1) { + ap_message next = (ap_message)fs; if (!do_try_send_message(next)) { break; } @@ -1196,7 +1197,7 @@ void GCS_MAVLINK::update_send() continue; } - next = next_deferred_bucket_message_to_send(); + ap_message next = next_deferred_bucket_message_to_send(); if (next != no_message_to_send) { if (!do_try_send_message(next)) { break;