Skip to content

Commit

Permalink
sa: only unlock if required
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Dec 14, 2024
1 parent 99ae7e4 commit d9fabad
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/io/vtx_smartaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d9fabad

Please sign in to comment.