1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

Add support for IRC Tramp race lock flag, and extended VTX status.

Display '-' for settings when VTX is locked.
This commit is contained in:
mikeller 2018-11-25 18:59:11 +13:00
parent 8140504f84
commit aeca5665e6
11 changed files with 154 additions and 79 deletions

View file

@ -1108,11 +1108,30 @@ static void osdElementVtxChannel(osdElementParms_t *element)
const vtxDevice_t *vtxDevice = vtxCommonDevice();
const char vtxBandLetter = vtxCommonLookupBandLetter(vtxDevice, vtxSettingsConfig()->band);
const char *vtxChannelName = vtxCommonLookupChannelName(vtxDevice, vtxSettingsConfig()->channel);
unsigned vtxStatus = 0;
uint8_t vtxPower = vtxSettingsConfig()->power;
if (vtxDevice && vtxSettingsConfig()->lowPowerDisarm) {
vtxCommonGetPowerIndex(vtxDevice, &vtxPower);
if (vtxDevice) {
vtxCommonGetStatus(vtxDevice, &vtxStatus);
if (vtxSettingsConfig()->lowPowerDisarm) {
vtxCommonGetPowerIndex(vtxDevice, &vtxPower);
}
}
char vtxStatusIndicator = '\0';
if (IS_RC_MODE_ACTIVE(BOXVTXCONTROLDISABLE)) {
vtxStatusIndicator = 'D';
} else if (vtxStatus & VTX_STATUS_PIT_MODE) {
vtxStatusIndicator = 'P';
}
if (vtxStatus & VTX_STATUS_LOCKED) {
tfp_sprintf(element->buff, "-:-:-:L");
} else if (vtxStatusIndicator) {
tfp_sprintf(element->buff, "%c:%s:%1d:%c", vtxBandLetter, vtxChannelName, vtxPower, vtxStatusIndicator);
} else {
tfp_sprintf(element->buff, "%c:%s:%1d", vtxBandLetter, vtxChannelName, vtxPower);
}
tfp_sprintf(element->buff, "%c:%s:%1d", vtxBandLetter, vtxChannelName, vtxPower);
}
#endif // USE_VTX_COMMON