mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Added a mcfg.telemetry_switch for CLI
If telemetry_switch=1 it change baudrate and protocol using aux channel, either it switch when armed/disarmed. This allows to keep MSP serial while armed for BT dongle if needed.
This commit is contained in:
parent
0d974e2882
commit
7bd2db04be
5 changed files with 12 additions and 6 deletions
|
@ -228,7 +228,11 @@ void initTelemetry(void)
|
|||
|
||||
void updateTelemetryState(void)
|
||||
{
|
||||
bool State = mcfg.telemetry_softserial != TELEMETRY_UART ? true : (f.ARMED || rcOptions[BOXTELEMETRY]);
|
||||
bool State;
|
||||
if (!mcfg.telemetry_switch)
|
||||
State = mcfg.telemetry_softserial != TELEMETRY_UART ? true : f.ARMED;
|
||||
else
|
||||
State = mcfg.telemetry_softserial != TELEMETRY_UART ? true : rcOptions[BOXTELEMETRY];
|
||||
|
||||
if (State != telemetryEnabled) {
|
||||
if (mcfg.telemetry_softserial == TELEMETRY_UART) {
|
||||
|
@ -246,7 +250,7 @@ static uint8_t cycleNum = 0;
|
|||
|
||||
void sendTelemetry(void)
|
||||
{
|
||||
if (mcfg.telemetry_softserial == TELEMETRY_UART && !f.ARMED && !rcOptions[BOXTELEMETRY])
|
||||
if ((mcfg.telemetry_softserial == TELEMETRY_UART && !f.ARMED && !mcfg.telemetry_switch) || ( mcfg.telemetry_switch && !rcOptions[BOXTELEMETRY]))
|
||||
return;
|
||||
|
||||
if (serialTotalBytesWaiting(core.telemport) != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue