Activity switch added (#6571)
This commit is contained in:
@@ -552,6 +552,8 @@ enum SwitchSources {
|
|||||||
SWSRC_FIRST_SENSOR,
|
SWSRC_FIRST_SENSOR,
|
||||||
SWSRC_LAST_SENSOR = SWSRC_FIRST_SENSOR+MAX_TELEMETRY_SENSORS-1,
|
SWSRC_LAST_SENSOR = SWSRC_FIRST_SENSOR+MAX_TELEMETRY_SENSORS-1,
|
||||||
|
|
||||||
|
SWSRC_RADIO_ACTIVITY,
|
||||||
|
|
||||||
#if defined(DEBUG_LATENCY)
|
#if defined(DEBUG_LATENCY)
|
||||||
SWSRC_LATENCY_TOGGLE,
|
SWSRC_LATENCY_TOGGLE,
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -326,6 +326,9 @@ char * getSwitchString(char * dest, swsrc_t idx)
|
|||||||
else if (idx == SWSRC_TELEMETRY_STREAMING) {
|
else if (idx == SWSRC_TELEMETRY_STREAMING) {
|
||||||
strcpy(s, "Tele");
|
strcpy(s, "Tele");
|
||||||
}
|
}
|
||||||
|
else if (idx == SWSRC_RADIO_ACTIVITY) {
|
||||||
|
strcpy(s, "Act");
|
||||||
|
}
|
||||||
#if defined(DEBUG_LATENCY)
|
#if defined(DEBUG_LATENCY)
|
||||||
else if (idx == SWSRC_LATENCY_TOGGLE) {
|
else if (idx == SWSRC_LATENCY_TOGGLE) {
|
||||||
strcpy(s, "Ltc");
|
strcpy(s, "Ltc");
|
||||||
|
|||||||
@@ -455,6 +455,9 @@ bool getSwitch(swsrc_t swtch, uint8_t flags)
|
|||||||
idx = (CONVERT_MODE_TRIMS(idx/2) << 1) + (idx & 1);
|
idx = (CONVERT_MODE_TRIMS(idx/2) << 1) + (idx & 1);
|
||||||
result = trimDown(idx);
|
result = trimDown(idx);
|
||||||
}
|
}
|
||||||
|
else if (cs_idx == SWSRC_RADIO_ACTIVITY) {
|
||||||
|
result = (inactivity.counter < 2);
|
||||||
|
}
|
||||||
else if (cs_idx >= SWSRC_FIRST_SENSOR) {
|
else if (cs_idx >= SWSRC_FIRST_SENSOR) {
|
||||||
result = !telemetryItems[cs_idx-SWSRC_FIRST_SENSOR].isOld();
|
result = !telemetryItems[cs_idx-SWSRC_FIRST_SENSOR].isOld();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user