diff --git a/src/main/cms/cms_menu_osd.c b/src/main/cms/cms_menu_osd.c index c7faeb073e..1cd9806efa 100644 --- a/src/main/cms/cms_menu_osd.c +++ b/src/main/cms/cms_menu_osd.c @@ -80,6 +80,7 @@ OSD_Entry menuOsdActiveElemsEntries[] = {"GPS SATS.", OME_VISIBLE, NULL, &osdProfile()->item_pos[OSD_GPS_SATS], 0}, #endif // GPS {"ALTITUDE", OME_VISIBLE, NULL, &osdProfile()->item_pos[OSD_ALTITUDE], 0}, + {"POWER", OME_VISIBLE, NULL, &osdProfile()->item_pos[OSD_POWER], 0}, {"BACK", OME_Back, NULL, NULL, 0}, {NULL, OME_END, NULL, NULL, 0} }; diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 563a6c8c26..41b511c47f 100755 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -360,6 +360,12 @@ static void osdDrawSingleElement(uint8_t item) break; } + case OSD_POWER: + { + sprintf(buff, "%dW", amperage * vbat / 1000); + break; + } + default: return; } @@ -402,6 +408,7 @@ void osdDrawElements(void) osdDrawSingleElement(OSD_ROLL_PIDS); osdDrawSingleElement(OSD_PITCH_PIDS); osdDrawSingleElement(OSD_YAW_PIDS); + osdDrawSingleElement(OSD_POWER); #ifdef GPS #ifdef CMS @@ -436,6 +443,7 @@ void osdResetConfig(osd_profile_t *osdProfile) osdProfile->item_pos[OSD_ROLL_PIDS] = OSD_POS(2, 10) | VISIBLE_FLAG; osdProfile->item_pos[OSD_PITCH_PIDS] = OSD_POS(2, 11) | VISIBLE_FLAG; osdProfile->item_pos[OSD_YAW_PIDS] = OSD_POS(2, 12) | VISIBLE_FLAG; + osdProfile->item_pos[OSD_POWER] = OSD_POS(15, 1); osdProfile->rssi_alarm = 20; osdProfile->cap_alarm = 2200; diff --git a/src/main/io/osd.h b/src/main/io/osd.h index 881dba9901..6f9dbfec36 100755 --- a/src/main/io/osd.h +++ b/src/main/io/osd.h @@ -45,6 +45,7 @@ typedef enum { OSD_ROLL_PIDS, OSD_PITCH_PIDS, OSD_YAW_PIDS, + OSD_POWER, OSD_ITEM_COUNT // MUST BE LAST } osd_items_e; diff --git a/src/main/io/serial_cli.c b/src/main/io/serial_cli.c index 03497d9ade..01a6069256 100755 --- a/src/main/io/serial_cli.c +++ b/src/main/io/serial_cli.c @@ -996,6 +996,7 @@ const clivalue_t valueTable[] = { { "osd_pid_roll_pos", VAR_UINT16 | MASTER_VALUE, &osdProfile()->item_pos[OSD_ROLL_PIDS], .config.minmax = { 0, UINT16_MAX } }, { "osd_pid_pitch_pos", VAR_UINT16 | MASTER_VALUE, &osdProfile()->item_pos[OSD_PITCH_PIDS], .config.minmax = { 0, UINT16_MAX } }, { "osd_pid_yaw_pos", VAR_UINT16 | MASTER_VALUE, &osdProfile()->item_pos[OSD_YAW_PIDS], .config.minmax = { 0, UINT16_MAX } }, + { "osd_power_pos", VAR_UINT16 | MASTER_VALUE, &osdProfile()->item_pos[OSD_POWER], .config.minmax = { 0, UINT16_MAX } }, #endif #ifdef USE_MAX7456 { "vcd_video_system", VAR_UINT8 | MASTER_VALUE, &vcdProfile()->video_system, .config.minmax = { 0, 2 } },