From cce89099c5c5fe722a191e1846b66f6adb42d02e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 Feb 2022 17:28:16 +1100 Subject: [PATCH] GCS_MAVLink: fixed mavlink packet corruption with multiple threads this ensures we don't try to send more data to a uart than is available in the tx buffer --- libraries/GCS_MAVLink/GCS_Common.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index b8a5284f5b..7c0e654823 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -2053,6 +2053,8 @@ void GCS_MAVLINK::service_statustext(void) { GCS::StatusTextQueue &_statustext_queue = gcs().statustext_queue(); + WITH_SEMAPHORE(comm_chan_lock(chan)); + const uint8_t chan_bit = (1U<