CF/BF - OSD - Show VTX channel/band hardware RTC6705 users (e.g.

SPRacingF3NEO/SINGULARITY)
This commit is contained in:
Hydra 2017-03-08 20:42:35 +00:00 committed by Dominic Clifton
parent e1ac5b82df
commit c8888ad6bd
2 changed files with 12 additions and 2 deletions

13
src/main/io/osd.c Executable file → Normal file
View File

@ -54,6 +54,9 @@
#include "drivers/system.h"
#ifdef USE_RTC6705
#include "drivers/vtx_soft_spi_rtc6705.h"
#include "drivers/vtx_soft_spi_rtc6705.h"
#elif defined(VTX)
#include "drivers/vtx_rtc6705.h"
#endif
#include "cms/cms.h"
@ -65,6 +68,7 @@
#include "io/gps.h"
#include "io/osd.h"
#include "io/vtx.h"
#include "io/vtx_string.h"
#include "fc/config.h"
#include "fc/rc_controls.h"
@ -284,10 +288,17 @@ static void osdDrawSingleElement(uint8_t item)
break;
}
#ifdef USE_RTC6705
#if defined(VTX) || defined(USE_RTC6705)
case OSD_VTX_CHANNEL:
{
// FIXME cleanup this when the VTX API is aligned for software vs hardware support of the RTC6705 - See SPRACINGF3NEO/SINGULARITY/SIRINFPV targets.
#if defined(VTX)
const char vtxBandLetter = vtx58BandLetter[vtxConfig()->vtx_band + 1];
const char *vtxChannelName = vtx58ChannelNames[vtxConfig()->vtx_channel + 1];
sprintf(buff, "%c:%s", vtxBandLetter, vtxChannelName);
#elif defined(USE_RTC6705)
sprintf(buff, "CH:%d", current_vtx_channel % CHANNELS_PER_BAND + 1);
#endif
break;
}
#endif // VTX

View File

@ -22,7 +22,6 @@
// Targets with built-in vtx do not need external vtx
#if defined(VTX) || defined(USE_RTC6705)
# undef VTX_CONTROL
# undef VTX_COMMON
# undef VTX_SMARTAUDIO
# undef VTX_TRAMP
#endif