From b8827e6486770e4a39a6b813ce5410d8873c1bae Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 16 Aug 2020 14:11:04 +1000 Subject: [PATCH] GCS_MAVLink: allow control to be return to radio for higher-numbered RC_CHANNELS_OVERRIDE --- libraries/GCS_MAVLink/GCS_Common.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 7957c84bd2..ae81a4a40c 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -3136,7 +3136,10 @@ void GCS_MAVLINK::handle_rc_channels_override(const mavlink_message_t &msg) // Per MAVLink spec a value of zero or UINT16_MAX means to // ignore this field. if (override_data[i] != 0 && override_data[i] != UINT16_MAX) { - RC_Channels::set_override(i, override_data[i], tnow); + // per the mavlink spec, a value of UINT16_MAX-1 means + // return the field to RC radio values: + const uint16_t value = override_data[i] == (UINT16_MAX-1) ? 0 : override_data[i]; + RC_Channels::set_override(i, value, tnow); } } }