tramp: moved common definitions to vtx_common

This commit is contained in:
Raphael Coeffic 2017-01-15 11:59:44 +01:00
parent 58a778c797
commit dddd09ae87
7 changed files with 37 additions and 44 deletions

View File

@ -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)))

View File

@ -1,26 +0,0 @@
#include <stdint.h>
#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",
};

View File

@ -1,8 +0,0 @@
#pragma once
#include <stdint.h>
extern const uint16_t vtx58FreqTable[5][8];
extern const char * const vtx58BandNames[];
extern const char * const vtx58ChanNames[];
extern const char vtx58BandLetter[];

View File

@ -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)
{

View File

@ -1,3 +1,10 @@
#pragma once
#include <stdint.h>
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);

View File

@ -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[] = {
"---",

View File

@ -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 };