mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +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,
|
BOXCALIB,
|
||||||
BOXGOV,
|
BOXGOV,
|
||||||
BOXOSD,
|
BOXOSD,
|
||||||
|
BOXTELEMETRY,
|
||||||
CHECKBOXITEMS
|
CHECKBOXITEMS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ struct box_t {
|
||||||
{ BOXCALIB, "CALIB;", 17 },
|
{ BOXCALIB, "CALIB;", 17 },
|
||||||
{ BOXGOV, "GOVERNOR;", 18 },
|
{ BOXGOV, "GOVERNOR;", 18 },
|
||||||
{ BOXOSD, "OSD SW;", 19 },
|
{ BOXOSD, "OSD SW;", 19 },
|
||||||
|
{ BOXTELEMETRY, "TELEMETRY;", 20 },
|
||||||
{ CHECKBOXITEMS, NULL, 0xFF }
|
{ CHECKBOXITEMS, NULL, 0xFF }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -265,6 +266,8 @@ void serialInit(uint32_t baudrate)
|
||||||
if (feature(FEATURE_INFLIGHT_ACC_CAL))
|
if (feature(FEATURE_INFLIGHT_ACC_CAL))
|
||||||
availableBoxes[idx++] = BOXCALIB;
|
availableBoxes[idx++] = BOXCALIB;
|
||||||
availableBoxes[idx++] = BOXOSD;
|
availableBoxes[idx++] = BOXOSD;
|
||||||
|
if (feature(FEATURE_TELEMETRY))
|
||||||
|
availableBoxes[idx++] = BOXTELEMETRY;
|
||||||
numberBoxItems = idx;
|
numberBoxItems = idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,6 +382,7 @@ static void evaluateCommand(void)
|
||||||
rcOptions[BOXCALIB] << BOXCALIB |
|
rcOptions[BOXCALIB] << BOXCALIB |
|
||||||
rcOptions[BOXGOV] << BOXGOV |
|
rcOptions[BOXGOV] << BOXGOV |
|
||||||
rcOptions[BOXOSD] << BOXOSD |
|
rcOptions[BOXOSD] << BOXOSD |
|
||||||
|
rcOptions[BOXTELEMETRY] << BOXTELEMETRY |
|
||||||
f.ARMED << BOXARM;
|
f.ARMED << BOXARM;
|
||||||
for (i = 0; i < numberBoxItems; i++) {
|
for (i = 0; i < numberBoxItems; i++) {
|
||||||
int flag = (tmp & (1 << availableBoxes[i]));
|
int flag = (tmp & (1 << availableBoxes[i]));
|
||||||
|
|
|
@ -228,7 +228,7 @@ void initTelemetry(void)
|
||||||
|
|
||||||
void updateTelemetryState(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 (State != telemetryEnabled) {
|
||||||
if (mcfg.telemetry_softserial == TELEMETRY_UART) {
|
if (mcfg.telemetry_softserial == TELEMETRY_UART) {
|
||||||
|
@ -246,7 +246,7 @@ static uint8_t cycleNum = 0;
|
||||||
|
|
||||||
void sendTelemetry(void)
|
void sendTelemetry(void)
|
||||||
{
|
{
|
||||||
if (mcfg.telemetry_softserial == TELEMETRY_UART && !f.ARMED)
|
if (mcfg.telemetry_softserial == TELEMETRY_UART && !f.ARMED && !rcOptions[BOXTELEMETRY])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (serialTotalBytesWaiting(core.telemport) != 0)
|
if (serialTotalBytesWaiting(core.telemport) != 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue