feat: Add trainer virtual switch (#3937)

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
3djc
2023-10-16 08:41:40 +10:00
committed by GitHub
co-authored by Peter Feerick
parent ee9d50dca4
commit d396b38e8b
20 changed files with 33 additions and 2 deletions
+2 -1
View File
@@ -47,13 +47,14 @@ class SwitchChoiceMenuToolbar : public MenuToolbar
#if defined(DEBUG_LATENCY)
auto lastSource = SWSRC_LATENCY_TOGGLE;
#else
auto lastSource = SWSRC_RADIO_ACTIVITY;
auto lastSource = SWSRC_TRAINER_CONNECTED;
#endif
addButton(
STR_CHAR_FUNCTION, SWSRC_ON, lastSource,
[=](int16_t index) {
index = abs(index);
return index == 0 || index == SWSRC_ON || index == SWSRC_ONE ||
index == SWSRC_TRAINER_CONNECTED ||
(index >= SWSRC_TELEMETRY_STREAMING && index <= lastSource &&
!(index >= SWSRC_FIRST_SENSOR && index <= SWSRC_LAST_SENSOR));
},