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:
parent
dd36fa4e3a
commit
47c81b525f
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
|
||||
|
||||
Enable workaround for early AKK SAudio-enabled VTX bug.
|
||||
|
|
|
@ -3602,6 +3602,11 @@ groups:
|
|||
default_value: ON
|
||||
field: smartAudioEarlyAkkWorkaroundEnable
|
||||
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
|
||||
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,
|
||||
.halfDuplex = SETTING_VTX_HALFDUPLEX_DEFAULT,
|
||||
.smartAudioEarlyAkkWorkaroundEnable = SETTING_VTX_SMARTAUDIO_EARLY_AKK_WORKAROUND_DEFAULT,
|
||||
.smartAudioAltSoftSerialMethod = SETTING_VTX_SMARTAUDIO_ALTERNATE_SOFTSERIAL_METHOD_DEFAULT,
|
||||
);
|
||||
|
||||
static uint8_t locked = 0;
|
||||
|
|
|
@ -32,6 +32,7 @@ typedef struct vtxConfig_s {
|
|||
vtxChannelActivationCondition_t vtxChannelActivationConditions[MAX_CHANNEL_ACTIVATION_CONDITION_COUNT];
|
||||
uint8_t halfDuplex;
|
||||
uint8_t smartAudioEarlyAkkWorkaroundEnable;
|
||||
bool smartAudioAltSoftSerialMethod;
|
||||
} vtxConfig_t;
|
||||
|
||||
PG_DECLARE(vtxConfig_t, vtxConfig);
|
||||
|
|
|
@ -492,9 +492,13 @@ static void saReceiveFramer(uint8_t c)
|
|||
|
||||
static void saSendFrame(uint8_t *buf, int len)
|
||||
{
|
||||
// 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);
|
||||
if ( (vtxConfig()->smartAudioAltSoftSerialMethod &&
|
||||
(smartAudioSerialPort->identifier == SERIAL_PORT_SOFTSERIAL1 || smartAudioSerialPort->identifier == SERIAL_PORT_SOFTSERIAL2))
|
||||
== 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++) {
|
||||
serialWrite(smartAudioSerialPort, buf[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue