1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00

Give options on the method to use for smartaudio over softserial

Initial code.
This commit is contained in:
Darren Lines 2021-11-30 20:50:00 +00:00 committed by Pawel Spychalski (DzikuVx)
parent dd36fa4e3a
commit 47c81b525f
5 changed files with 24 additions and 3 deletions

View file

@ -5712,6 +5712,16 @@ VTX RF power level to use. The exact number of mw depends on the VTX hardware.
--- ---
### vtx_smartaudio_alternate_softserial_method
Enable the alternate softserial method. This is the method used in iNav 3.0 and ealier.
| Default | Min | Max |
| --- | --- | --- |
| ON | | |
---
### vtx_smartaudio_early_akk_workaround ### vtx_smartaudio_early_akk_workaround
Enable workaround for early AKK SAudio-enabled VTX bug. Enable workaround for early AKK SAudio-enabled VTX bug.

View file

@ -3602,6 +3602,11 @@ groups:
default_value: ON default_value: ON
field: smartAudioEarlyAkkWorkaroundEnable field: smartAudioEarlyAkkWorkaroundEnable
type: bool type: bool
- name: vtx_smartaudio_alternate_softserial_method
description: "Enable the alternate softserial method. This is the method used in iNav 3.0 and ealier."
default_value: ON
field: smartAudioAltSoftSerialMethod
type: bool
- name: PG_VTX_SETTINGS_CONFIG - name: PG_VTX_SETTINGS_CONFIG
type: vtxSettingsConfig_t type: vtxSettingsConfig_t

View file

@ -45,6 +45,7 @@ PG_REGISTER_WITH_RESET_TEMPLATE(vtxConfig_t, vtxConfig, PG_VTX_CONFIG, 3);
PG_RESET_TEMPLATE(vtxConfig_t, vtxConfig, PG_RESET_TEMPLATE(vtxConfig_t, vtxConfig,
.halfDuplex = SETTING_VTX_HALFDUPLEX_DEFAULT, .halfDuplex = SETTING_VTX_HALFDUPLEX_DEFAULT,
.smartAudioEarlyAkkWorkaroundEnable = SETTING_VTX_SMARTAUDIO_EARLY_AKK_WORKAROUND_DEFAULT, .smartAudioEarlyAkkWorkaroundEnable = SETTING_VTX_SMARTAUDIO_EARLY_AKK_WORKAROUND_DEFAULT,
.smartAudioAltSoftSerialMethod = SETTING_VTX_SMARTAUDIO_ALTERNATE_SOFTSERIAL_METHOD_DEFAULT,
); );
static uint8_t locked = 0; static uint8_t locked = 0;

View file

@ -32,6 +32,7 @@ typedef struct vtxConfig_s {
vtxChannelActivationCondition_t vtxChannelActivationConditions[MAX_CHANNEL_ACTIVATION_CONDITION_COUNT]; vtxChannelActivationCondition_t vtxChannelActivationConditions[MAX_CHANNEL_ACTIVATION_CONDITION_COUNT];
uint8_t halfDuplex; uint8_t halfDuplex;
uint8_t smartAudioEarlyAkkWorkaroundEnable; uint8_t smartAudioEarlyAkkWorkaroundEnable;
bool smartAudioAltSoftSerialMethod;
} vtxConfig_t; } vtxConfig_t;
PG_DECLARE(vtxConfig_t, vtxConfig); PG_DECLARE(vtxConfig_t, vtxConfig);

View file

@ -492,9 +492,13 @@ static void saReceiveFramer(uint8_t c)
static void saSendFrame(uint8_t *buf, int len) static void saSendFrame(uint8_t *buf, int len)
{ {
// TBS SA definition requires that the line is low before frame is sent if ( (vtxConfig()->smartAudioAltSoftSerialMethod &&
// (for both soft and hard serial). It can be done by sending first 0x00 (smartAudioSerialPort->identifier == SERIAL_PORT_SOFTSERIAL1 || smartAudioSerialPort->identifier == SERIAL_PORT_SOFTSERIAL2))
serialWrite(smartAudioSerialPort, 0x00); == false) {
// TBS SA definition requires that the line is low before frame is sent
// (for both soft and hard serial). It can be done by sending first 0x00
serialWrite(smartAudioSerialPort, 0x00);
}
for (int i = 0 ; i < len ; i++) { for (int i = 0 ; i < len ; i++) {
serialWrite(smartAudioSerialPort, buf[i]); serialWrite(smartAudioSerialPort, buf[i]);