Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added vtx_smartaudio_early_akk_workaround option #6458

Merged
merged 7 commits into from
Feb 5, 2021
Merged
1 change: 1 addition & 0 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@
| vtx_max_power_override | 0 | Some VTXes may report max power incorrectly (i.e. 200mW for a 600mW VTX). Use this to override max supported power. 0 to disable and use whatever VTX reports as its capabilities |
| vtx_pit_mode_chan | | |
| vtx_power | 1 | VTX RF power level to use. The exact number of mw depends on the VTX hardware. |
| vtx_smartaudio_early_akk_workaround | ON | Enable workaround for early AKK SAudio-enabled VTX bug. |
| yaw_deadband | 5 | These are values (in us) by how much RC input can be different before it's considered valid. For transmitters with jitter on outputs, this value can be increased. Defaults are zero, but can be increased up to 10 or so if rc inputs twitch while idle. |
| yaw_lpf_hz | 30 | Yaw low pass filter cutoff frequency. Should be disabled (set to `0`) on small multirotors (7 inches and below) |
| yaw_rate | 20 | Defines rotation rate on YAW axis that UAV will try to archive on max. stick deflection. Rates are defined in tens of degrees (deca-degrees) per second [rate = dps/10]. That means, rate 20 represents 200dps rotation speed. Default 20 (200dps) is more less equivalent of old Cleanflight/Baseflight rate 0. Max. 180 (1800dps) is what gyro can measure. |
Expand Down
5 changes: 5 additions & 0 deletions src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,11 @@ groups:
default_value: "ON"
field: halfDuplex
type: bool
- name: vtx_smartaudio_early_akk_workaround
description: "Enable workaround for early AKK SAudio-enabled VTX bug."
default_value: "ON"
field: smartAudioEarlyAkkWorkaroundEnable
type: bool

- name: PG_VTX_SETTINGS_CONFIG
type: vtxSettingsConfig_t
Expand Down
3 changes: 2 additions & 1 deletion src/main/io/vtx_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@

#if defined(USE_VTX_CONTROL)

PG_REGISTER_WITH_RESET_TEMPLATE(vtxConfig_t, vtxConfig, PG_VTX_CONFIG, 2);
PG_REGISTER_WITH_RESET_TEMPLATE(vtxConfig_t, vtxConfig, PG_VTX_CONFIG, 3);

PG_RESET_TEMPLATE(vtxConfig_t, vtxConfig,
.halfDuplex = true,
.smartAudioEarlyAkkWorkaroundEnable = true,
);

static uint8_t locked = 0;
Expand Down
1 change: 1 addition & 0 deletions src/main/io/vtx_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ typedef struct vtxChannelActivationCondition_s {
typedef struct vtxConfig_s {
vtxChannelActivationCondition_t vtxChannelActivationConditions[MAX_CHANNEL_ACTIVATION_CONDITION_COUNT];
uint8_t halfDuplex;
uint8_t smartAudioEarlyAkkWorkaroundEnable;
RomanLut marked this conversation as resolved.
Show resolved Hide resolved
} vtxConfig_t;

PG_DECLARE(vtxConfig_t, vtxConfig);
Expand Down
3 changes: 2 additions & 1 deletion src/main/io/vtx_smartaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ static void saSendFrame(uint8_t *buf, int len)
// XXX: Workaround for early AKK SAudio-enabled VTX bug,
// shouldn't cause any problems with VTX with properly
// implemented SAudio.
serialWrite(smartAudioSerialPort, 0x00);
//Update: causes problem with new AKK AIO camera connected to SoftUART
if (vtxConfig()->smartAudioEarlyAkkWorkaroundEnable) serialWrite(smartAudioSerialPort, 0x00);

sa_lastTransmissionMs = millis();
saStat.pktsent++;
Expand Down