From d9fabad4e8d1ed54c72d271ff82bad94766a584e Mon Sep 17 00:00:00 2001 From: bkleiner Date: Sat, 14 Dec 2024 17:13:56 +0100 Subject: [PATCH] sa: only unlock if required --- src/io/vtx_smartaudio.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/io/vtx_smartaudio.c b/src/io/vtx_smartaudio.c index 7701deaa4..1d591c840 100644 --- a/src/io/vtx_smartaudio.c +++ b/src/io/vtx_smartaudio.c @@ -161,13 +161,17 @@ void smart_audio_set_power_level(vtx_power_level_t power) { void smart_audio_set_pit_mode(vtx_pit_mode_t pit_mode) { if (smart_audio_settings.version >= 3) { - uint8_t mode = 0x0; + uint8_t mode = 0; + + if ((smart_audio_settings.mode & SA_MODE_UNLOCKED) != 0) { + mode |= (1 << 3); // unlock + } if (pit_mode == VTX_PIT_MODE_OFF) { - mode |= 0x08; + mode |= (1 << 2); } else if (pit_mode == VTX_PIT_MODE_ON) { // out-range was dropped for VTXes with SA >= v2.1 - mode |= 0x09; + mode |= (1 << 0); } serial_smart_audio_send_payload(SA_CMD_SET_MODE, &mode, 1);