diff --git a/Makefile b/Makefile index c04f22854..1a7a352ab 100644 --- a/Makefile +++ b/Makefile @@ -610,7 +610,6 @@ HIGHEND_SRC = \ telemetry/mavlink.c \ telemetry/ibus.c \ sensors/esc_sensor.c \ - drivers/vtx_var.c \ io/vtx_common.c \ io/vtx_smartaudio.c \ io/vtx_tramp.c @@ -718,8 +717,8 @@ SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \ cms/cms_menu_misc.c \ cms/cms_menu_osd.c \ cms/cms_menu_vtx.c \ - io/vtx_smartaudio.c - # io/vtx_tramp.c # makes binary bigger!? + io/vtx_smartaudio.c \ + io/vtx_tramp.c endif #F3 ifeq ($(TARGET),$(filter $(TARGET),$(F4_TARGETS))) diff --git a/src/main/drivers/vtx_var.c b/src/main/drivers/vtx_var.c deleted file mode 100644 index f541b4a6a..000000000 --- a/src/main/drivers/vtx_var.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include "vtx_var.h" - -const uint16_t vtx58FreqTable[5][8] = -{ - { 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725 }, // Boscam A - { 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866 }, // Boscam B - { 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945 }, // Boscam E - { 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880 }, // FatShark - { 5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917 }, // RaceBand -}; - -const char * const vtx58BandNames[] = { - "--------", - "BOSCAM A", - "BOSCAM B", - "BOSCAM E", - "FATSHARK", - "RACEBAND", -}; - -const char vtx58BandLetter[] = "-ABEFR"; - -const char * const vtx58ChanNames[] = { - "-", "1", "2", "3", "4", "5", "6", "7", "8", -}; diff --git a/src/main/drivers/vtx_var.h b/src/main/drivers/vtx_var.h deleted file mode 100644 index c8e7cdf2d..000000000 --- a/src/main/drivers/vtx_var.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include - -extern const uint16_t vtx58FreqTable[5][8]; -extern const char * const vtx58BandNames[]; -extern const char * const vtx58ChanNames[]; -extern const char vtx58BandLetter[]; diff --git a/src/main/io/vtx_common.c b/src/main/io/vtx_common.c index 62b9c00f0..5f89be8dd 100644 --- a/src/main/io/vtx_common.c +++ b/src/main/io/vtx_common.c @@ -25,8 +25,31 @@ #include "platform.h" #include "build/debug.h" -#if defined(VTX_TRAMP) -#include "drivers/vtx_var.h" +#if defined(VTX_CONTROL) + +const uint16_t vtx58FreqTable[5][8] = +{ + { 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725 }, // Boscam A + { 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866 }, // Boscam B + { 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945 }, // Boscam E + { 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880 }, // FatShark + { 5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917 }, // RaceBand +}; + +const char * const vtx58BandNames[] = { + "--------", + "BOSCAM A", + "BOSCAM B", + "BOSCAM E", + "FATSHARK", + "RACEBAND", +}; + +const char vtx58BandLetter[] = "-ABEFR"; + +const char * const vtx58ChannelNames[] = { + "-", "1", "2", "3", "4", "5", "6", "7", "8", +}; bool vtx58_Freq2Bandchan(uint16_t freq, uint8_t *pBand, uint8_t *pChan) { diff --git a/src/main/io/vtx_common.h b/src/main/io/vtx_common.h index 8c260279b..c4f5c4e47 100644 --- a/src/main/io/vtx_common.h +++ b/src/main/io/vtx_common.h @@ -1,3 +1,10 @@ #pragma once +#include + +extern const uint16_t vtx58FreqTable[5][8]; +extern const char * const vtx58BandNames[]; +extern const char * const vtx58ChannelNames[]; +extern const char vtx58BandLetter[]; + bool vtx58_Freq2Bandchan(uint16_t freq, uint8_t *pBand, uint8_t *pChan); diff --git a/src/main/io/vtx_smartaudio.c b/src/main/io/vtx_smartaudio.c index 8ece43894..e5118a4f0 100644 --- a/src/main/io/vtx_smartaudio.c +++ b/src/main/io/vtx_smartaudio.c @@ -33,7 +33,6 @@ #include "common/utils.h" #include "drivers/system.h" #include "drivers/serial.h" -#include "drivers/vtx_var.h" #include "io/serial.h" #include "io/vtx_smartaudio.h" @@ -985,7 +984,7 @@ static CMS_Menu saCmsMenuStats = { static OSD_TAB_t saCmsEntBand = { &saCmsBand, 5, vtx58BandNames, NULL }; -static OSD_TAB_t saCmsEntChan = { &saCmsChan, 8, &vtx58ChanNames[0], NULL }; +static OSD_TAB_t saCmsEntChan = { &saCmsChan, 8, &vtx58ChannelNames[0], NULL }; static const char * const saCmsPowerNames[] = { "---", diff --git a/src/main/io/vtx_tramp.c b/src/main/io/vtx_tramp.c index d6e848715..72fc990e4 100644 --- a/src/main/io/vtx_tramp.c +++ b/src/main/io/vtx_tramp.c @@ -33,7 +33,6 @@ #include "io/serial.h" #include "drivers/serial.h" -#include "drivers/vtx_var.h" #include "drivers/system.h" #include "io/vtx_tramp.h" #include "io/vtx_common.h" @@ -358,7 +357,7 @@ static void trampCmsUpdateStatusString(void) trampCmsStatusString[0] = '*'; trampCmsStatusString[1] = ' '; trampCmsStatusString[2] = vtx58BandLetter[trampCurBand]; - trampCmsStatusString[3] = vtx58ChanNames[trampCurChan][0]; + trampCmsStatusString[3] = vtx58ChannelNames[trampCurChan][0]; trampCmsStatusString[4] = ' '; if (trampCurFreq) @@ -380,7 +379,7 @@ uint16_t trampCmsFreqRef; static OSD_TAB_t trampCmsEntBand = { &trampCmsBand, 5, vtx58BandNames, NULL }; -static OSD_TAB_t trampCmsEntChan = { &trampCmsChan, 8, vtx58ChanNames, NULL }; +static OSD_TAB_t trampCmsEntChan = { &trampCmsChan, 8, vtx58ChannelNames, NULL }; static OSD_UINT16_t trampCmsEntFreqRef = { &trampCmsFreqRef, 5600, 5900, 0 };