From 26b88823f4bac2400f1c43374d19c4fc34552cc5 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 25 Apr 2020 08:23:22 +1000 Subject: [PATCH] GCS_MAVLink: correct out-of-space-to-send call in HAVE_PAYLOAD_SPACE --- libraries/GCS_MAVLink/GCS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index b4f5fe236e..fe57b79b91 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -44,7 +44,7 @@ void gcs_out_of_space_to_send_count(mavlink_channel_t chan); // anywhere in the code to determine if the mavlink message with ID id // can currently fit in the output of _chan. Note the use of the "," // operator here to increment a counter. -#define HAVE_PAYLOAD_SPACE(_chan, id) (comm_get_txspace(_chan) >= PAYLOAD_SIZE(_chan, id) ? (gcs_out_of_space_to_send_count(_chan), true) : false) +#define HAVE_PAYLOAD_SPACE(_chan, id) (comm_get_txspace(_chan) >= PAYLOAD_SIZE(_chan, id) ? true : (gcs_out_of_space_to_send_count(_chan), false)) // CHECK_PAYLOAD_SIZE - macro which may only be used within a // GCS_MAVLink object's methods. It inserts code which will