mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
added vtx osd channel variant element
This commit is contained in:
parent
18ee33e7a8
commit
5cf79f0b2b
1 changed files with 18 additions and 6 deletions
|
@ -96,6 +96,10 @@
|
|||
type 2: Graphical bar showing battery used (grows as used)
|
||||
type 3: Numeric % of remaining battery
|
||||
type 4: Numeric % or used battery
|
||||
|
||||
VTX_CHANNEL
|
||||
type 1: Contains Band:Channel:Power:Pit
|
||||
type 2: Contains only Power
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
@ -1454,12 +1458,20 @@ static void osdElementVtxChannel(osdElementParms_t *element)
|
|||
vtxStatusIndicator = 'P';
|
||||
}
|
||||
|
||||
if (vtxStatus & VTX_STATUS_LOCKED) {
|
||||
tfp_sprintf(element->buff, "-:-:-:L");
|
||||
} else if (vtxStatusIndicator) {
|
||||
tfp_sprintf(element->buff, "%c:%s:%s:%c", vtxBandLetter, vtxChannelName, vtxPowerLabel, vtxStatusIndicator);
|
||||
} else {
|
||||
tfp_sprintf(element->buff, "%c:%s:%s", vtxBandLetter, vtxChannelName, vtxPowerLabel);
|
||||
switch (element->type) {
|
||||
case OSD_ELEMENT_TYPE_2:
|
||||
tfp_sprintf(element->buff, "%s", vtxPowerLabel);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (vtxStatus & VTX_STATUS_LOCKED) {
|
||||
tfp_sprintf(element->buff, "-:-:-:L");
|
||||
} else if (vtxStatusIndicator) {
|
||||
tfp_sprintf(element->buff, "%c:%s:%s:%c", vtxBandLetter, vtxChannelName, vtxPowerLabel, vtxStatusIndicator);
|
||||
} else {
|
||||
tfp_sprintf(element->buff, "%c:%s:%s", vtxBandLetter, vtxChannelName, vtxPowerLabel);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // USE_VTX_COMMON
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue