From bfcefa3f34ef51d8e2950c400171c8412961dff1 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Mon, 5 Apr 2021 11:17:03 +0100 Subject: [PATCH] AP_VideoTX: prioritize pitmode changes over power changes --- libraries/AP_VideoTX/AP_SmartAudio.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/AP_VideoTX/AP_SmartAudio.cpp b/libraries/AP_VideoTX/AP_SmartAudio.cpp index 86742ff690..a48a96e95d 100644 --- a/libraries/AP_VideoTX/AP_SmartAudio.cpp +++ b/libraries/AP_VideoTX/AP_SmartAudio.cpp @@ -201,7 +201,14 @@ void AP_SmartAudio::update_vtx_params() } } - if (_vtx_freq_change_pending) { + if (pitMode) {// prevent power changes in pitmode as this takes the VTX out of pitmode + _vtx_power_change_pending = false; + } + + // prioritize pitmode changes + if (_vtx_options_change_pending) { + set_operation_mode(mode); + } else if (_vtx_freq_change_pending) { if (_vtx_use_set_freq) { set_frequency(vtx.get_configured_frequency_mhz(), false); } else { @@ -224,8 +231,6 @@ void AP_SmartAudio::update_vtx_params() } break; } - } else if (_vtx_options_change_pending) { - set_operation_mode(mode); } } }