Skip to content

Commit 8398d82

Browse files
committed
OSD: add VTX power indicator
Complement to iNavFlight#4717. It is now possible to change the VTX power setting in flight. This allows to see what power the VTX is set at and also when the VTX power RC adjustment is active.
1 parent 732e118 commit 8398d82

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/main/cms/cms_menu_osd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ static const OSD_Entry menuOsdElemsEntries[] =
258258
OSD_ELEMENT_ENTRY("BARO TEMP", OSD_BARO_TEMPERATURE),
259259
#endif
260260

261+
OSD_ELEMENT_ENTRY("VTX POWER", OSD_VTX_POWER),
262+
261263
#ifdef USE_TEMPERATURE_SENSOR
262264
OSD_ELEMENT_ENTRY("SENSOR 0 TEMP", OSD_TEMP_SENSOR_0_TEMPERATURE),
263265
OSD_ELEMENT_ENTRY("SENSOR 1 TEMP", OSD_TEMP_SENSOR_1_TEMPERATURE),

src/main/io/osd.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
#include "io/flashfs.h"
6262
#include "io/gps.h"
6363
#include "io/osd.h"
64+
#include "io/vtx.h"
6465
#include "io/vtx_string.h"
6566

6667
#include "fc/config.h"
@@ -2516,6 +2517,14 @@ static bool osdDrawSingleElement(uint8_t item)
25162517
}
25172518
#endif
25182519

2520+
case OSD_VTX_POWER:
2521+
{
2522+
tfp_sprintf(buff, "%d", vtxSettingsConfig()->power);
2523+
if (isAdjustmentFunctionSelected(ADJUSTMENT_VTX_POWER_LEVEL)) TEXT_ATTRIBUTES_ADD_BLINK(elemAttr);
2524+
displayWriteWithAttr(osdDisplayPort, elemPosX, elemPosY, buff, elemAttr);
2525+
return true;
2526+
}
2527+
25192528
default:
25202529
return false;
25212530
}
@@ -2719,6 +2728,8 @@ void pgResetFn_osdConfig(osdConfig_t *osdConfig)
27192728
osdConfig->item_pos[0][OSD_GFORCE_Y] = OSD_POS(12, 6);
27202729
osdConfig->item_pos[0][OSD_GFORCE_Z] = OSD_POS(12, 7);
27212730

2731+
osdConfig->item_pos[0][OSD_VTX_POWER] = OSD_POS(3, 5);
2732+
27222733
#if defined(USE_RX_MSP) && defined(USE_MSP_RC_OVERRIDE)
27232734
osdConfig->item_pos[0][OSD_RC_SOURCE] = OSD_POS(3, 4);
27242735
#endif

src/main/io/osd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ typedef enum {
142142
OSD_GFORCE_Y,
143143
OSD_GFORCE_Z,
144144
OSD_RC_SOURCE,
145+
OSD_VTX_POWER,
145146
OSD_ITEM_COUNT // MUST BE LAST
146147
} osd_items_e;
147148

0 commit comments

Comments
 (0)