mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 06:45:16 +03:00
Start Frsky telemetry using a switch without beeing armed.
This adds a Telemetry checkbox in the gui.
This commit is contained in:
parent
8c4a594808
commit
e6889aea12
3 changed files with 7 additions and 2 deletions
1
src/mw.h
1
src/mw.h
|
@ -101,6 +101,7 @@ enum {
|
|||
BOXCALIB,
|
||||
BOXGOV,
|
||||
BOXOSD,
|
||||
BOXTELEMETRY,
|
||||
CHECKBOXITEMS
|
||||
};
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@ struct box_t {
|
|||
{ BOXCALIB, "CALIB;", 17 },
|
||||
{ BOXGOV, "GOVERNOR;", 18 },
|
||||
{ BOXOSD, "OSD SW;", 19 },
|
||||
{ BOXTELEMETRY, "TELEMETRY;", 20 },
|
||||
{ CHECKBOXITEMS, NULL, 0xFF }
|
||||
};
|
||||
|
||||
|
@ -265,6 +266,8 @@ void serialInit(uint32_t baudrate)
|
|||
if (feature(FEATURE_INFLIGHT_ACC_CAL))
|
||||
availableBoxes[idx++] = BOXCALIB;
|
||||
availableBoxes[idx++] = BOXOSD;
|
||||
if (feature(FEATURE_TELEMETRY))
|
||||
availableBoxes[idx++] = BOXTELEMETRY;
|
||||
numberBoxItems = idx;
|
||||
}
|
||||
|
||||
|
@ -379,6 +382,7 @@ static void evaluateCommand(void)
|
|||
rcOptions[BOXCALIB] << BOXCALIB |
|
||||
rcOptions[BOXGOV] << BOXGOV |
|
||||
rcOptions[BOXOSD] << BOXOSD |
|
||||
rcOptions[BOXTELEMETRY] << BOXTELEMETRY |
|
||||
f.ARMED << BOXARM;
|
||||
for (i = 0; i < numberBoxItems; i++) {
|
||||
int flag = (tmp & (1 << availableBoxes[i]));
|
||||
|
|
|
@ -228,7 +228,7 @@ void initTelemetry(void)
|
|||
|
||||
void updateTelemetryState(void)
|
||||
{
|
||||
bool State = mcfg.telemetry_softserial != TELEMETRY_UART ? true : f.ARMED;
|
||||
bool State = mcfg.telemetry_softserial != TELEMETRY_UART ? true : (f.ARMED || rcOptions[BOXTELEMETRY]);
|
||||
|
||||
if (State != telemetryEnabled) {
|
||||
if (mcfg.telemetry_softserial == TELEMETRY_UART) {
|
||||
|
@ -246,7 +246,7 @@ static uint8_t cycleNum = 0;
|
|||
|
||||
void sendTelemetry(void)
|
||||
{
|
||||
if (mcfg.telemetry_softserial == TELEMETRY_UART && !f.ARMED)
|
||||
if (mcfg.telemetry_softserial == TELEMETRY_UART && !f.ARMED && !rcOptions[BOXTELEMETRY])
|
||||
return;
|
||||
|
||||
if (serialTotalBytesWaiting(core.telemport) != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue