1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Use parameter group to populate vtx channel in OSD

This commit is contained in:
Curtis Bangert 2017-11-10 21:18:54 -05:00
parent 0c84506336
commit 01a78ef77f

View file

@ -56,7 +56,6 @@
#include "drivers/display.h" #include "drivers/display.h"
#include "drivers/max7456_symbols.h" #include "drivers/max7456_symbols.h"
#include "drivers/time.h" #include "drivers/time.h"
#include "drivers/vtx_common.h"
#include "io/asyncfatfs/asyncfatfs.h" #include "io/asyncfatfs/asyncfatfs.h"
#include "io/beeper.h" #include "io/beeper.h"
@ -66,6 +65,7 @@
#include "io/vtx_rtc6705.h" #include "io/vtx_rtc6705.h"
#include "io/vtx_control.h" #include "io/vtx_control.h"
#include "io/vtx_string.h" #include "io/vtx_string.h"
#include "io/vtx.h"
#include "fc/config.h" #include "fc/config.h"
#include "fc/rc_controls.h" #include "fc/rc_controls.h"
@ -475,15 +475,9 @@ static void osdDrawSingleElement(uint8_t item)
#if defined(VTX_COMMON) #if defined(VTX_COMMON)
case OSD_VTX_CHANNEL: case OSD_VTX_CHANNEL:
{ {
uint8_t band=0, channel=0; const char vtxBandLetter = vtx58BandLetter[vtxSettingsConfig()->band];
vtxCommonGetBandAndChannel(&band,&channel); const char *vtxChannelName = vtx58ChannelNames[vtxSettingsConfig()->channel];
tfp_sprintf(buff, "%c:%s:%d", vtxBandLetter, vtxChannelName, vtxSettingsConfig()->power);
uint8_t power = 0;
vtxCommonGetPowerIndex(&power);
const char vtxBandLetter = vtx58BandLetter[band];
const char *vtxChannelName = vtx58ChannelNames[channel];
tfp_sprintf(buff, "%c:%s:%d", vtxBandLetter, vtxChannelName, power);
break; break;
} }
#endif #endif