1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 04:15:26 +03:00

Activity switch added (#6571)

This commit is contained in:
Bertrand Songis 2019-07-15 22:27:55 +02:00 committed by GitHub
parent cc1196db3d
commit c13a09f707
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -552,6 +552,8 @@ enum SwitchSources {
SWSRC_FIRST_SENSOR,
SWSRC_LAST_SENSOR = SWSRC_FIRST_SENSOR+MAX_TELEMETRY_SENSORS-1,
SWSRC_RADIO_ACTIVITY,
#if defined(DEBUG_LATENCY)
SWSRC_LATENCY_TOGGLE,
#endif

View file

@ -326,6 +326,9 @@ char * getSwitchString(char * dest, swsrc_t idx)
else if (idx == SWSRC_TELEMETRY_STREAMING) {
strcpy(s, "Tele");
}
else if (idx == SWSRC_RADIO_ACTIVITY) {
strcpy(s, "Act");
}
#if defined(DEBUG_LATENCY)
else if (idx == SWSRC_LATENCY_TOGGLE) {
strcpy(s, "Ltc");

View file

@ -455,6 +455,9 @@ bool getSwitch(swsrc_t swtch, uint8_t flags)
idx = (CONVERT_MODE_TRIMS(idx/2) << 1) + (idx & 1);
result = trimDown(idx);
}
else if (cs_idx == SWSRC_RADIO_ACTIVITY) {
result = (inactivity.counter < 2);
}
else if (cs_idx >= SWSRC_FIRST_SENSOR) {
result = !telemetryItems[cs_idx-SWSRC_FIRST_SENSOR].isOld();
}