mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
Merge pull request #7641 from iNavFlight/MrD-add-options-for-SmartAudio-over-SoftSerial
Give options on the method to use for SmartAudio over SoftSerial
This commit is contained in:
commit
d7eb4877d0
5 changed files with 24 additions and 3 deletions
|
@ -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.
|
||||||
|
|
|
@ -3601,6 +3601,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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue