diff --git a/radio/src/dataconstants.h b/radio/src/dataconstants.h index 4f8013582..2345cdb3a 100644 --- a/radio/src/dataconstants.h +++ b/radio/src/dataconstants.h @@ -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 diff --git a/radio/src/strhelpers.cpp b/radio/src/strhelpers.cpp index 591723571..a3290ddcd 100644 --- a/radio/src/strhelpers.cpp +++ b/radio/src/strhelpers.cpp @@ -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"); diff --git a/radio/src/switches.cpp b/radio/src/switches.cpp index 642dd704b..b24999227 100644 --- a/radio/src/switches.cpp +++ b/radio/src/switches.cpp @@ -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(); }