feat: ELRS bind command support (#4907)

This commit is contained in:
3djc
2024-06-02 12:03:15 +10:00
committed by GitHub
parent c81c8b5354
commit d45450921d
30 changed files with 174 additions and 29 deletions
+6 -1
View File
@@ -1837,7 +1837,10 @@ void menuModelSetup(event_t event)
l_posHorz += 1;
}
if (isModuleBindRangeAvailable(moduleIdx)) {
lcdDrawText(bindButtonPos, y, STR_MODULE_BIND, l_posHorz == 1 ? attr : 0);
if (TELEMETRY_STREAMING() && isModuleELRS(moduleIdx))
lcdDrawText(bindButtonPos, y, STR_MODULE_UNBIND, l_posHorz == 1 ? attr : 0);
else
lcdDrawText(bindButtonPos, y, STR_MODULE_BIND, l_posHorz == 1 ? attr : 0);
if (isModuleRangeAvailable(moduleIdx)) {
lcdDrawText(lcdNextPos + 2, y, STR_MODULE_RANGE, l_posHorz == 2 ? attr : 0);
}
@@ -1881,6 +1884,8 @@ void menuModelSetup(event_t event)
}
else {
newFlag = MODULE_MODE_BIND;
if (isModuleELRS(moduleIdx))
AUDIO_PLAY(AU_SPECIAL_SOUND_CHEEP); // Since ELRS bind is just one frame, we need to play the sound manually
}
if (!event && (oldFlag != newFlag) &&