Merge pull request #7540 from jflyper/bfdev-vtx-table-tramp

[VTX] Convert Tramp driver to use VTX table facility
This commit is contained in:
Michael Keller 2019-02-07 23:57:09 +13:00 committed by GitHub
commit 760300b562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -38,6 +38,10 @@
#include "drivers/vtx_common.h" #include "drivers/vtx_common.h"
#ifdef USE_VTX_TABLE
#include "drivers/vtx_table.h"
#endif
#include "io/serial.h" #include "io/serial.h"
#include "io/vtx_tramp.h" #include "io/vtx_tramp.h"
#include "io/vtx_control.h" #include "io/vtx_control.h"
@ -616,6 +620,17 @@ bool vtxTrampInit(void)
// XXX Effect of USE_VTX_COMMON should be reviewed, as following call to vtxInit will do nothing if vtxCommonSetDevice is not called. // XXX Effect of USE_VTX_COMMON should be reviewed, as following call to vtxInit will do nothing if vtxCommonSetDevice is not called.
#if defined(USE_VTX_COMMON) #if defined(USE_VTX_COMMON)
#if defined(USE_VTX_TABLE)
vtxTramp.capability.bandCount = vtxTableBandCount;
vtxTramp.capability.channelCount = vtxTableChannelCount;
vtxTramp.capability.powerCount = vtxTablePowerLevels;
vtxTramp.frequencyTable = (uint16_t *)vtxTableFrequency;
vtxTramp.bandNames = vtxTableBandNames;
vtxTramp.bandLetters = vtxTableBandLetters;
vtxTramp.channelNames = vtxTableChannelNames;
vtxTramp.powerNames = vtxTablePowerLabels;
vtxTramp.powerValues = vtxTablePowerValues;
#else
vtxTramp.capability.bandCount = VTX_TRAMP_BAND_COUNT; vtxTramp.capability.bandCount = VTX_TRAMP_BAND_COUNT;
vtxTramp.capability.channelCount = VTX_TRAMP_CHANNEL_COUNT; vtxTramp.capability.channelCount = VTX_TRAMP_CHANNEL_COUNT;
vtxTramp.capability.powerCount = sizeof(trampPowerTable), vtxTramp.capability.powerCount = sizeof(trampPowerTable),
@ -625,6 +640,7 @@ bool vtxTrampInit(void)
vtxTramp.channelNames = vtxStringChannelNames(); vtxTramp.channelNames = vtxStringChannelNames();
vtxTramp.powerNames = trampPowerNames; vtxTramp.powerNames = trampPowerNames;
vtxTramp.powerValues = trampPowerTable; vtxTramp.powerValues = trampPowerTable;
#endif
vtxCommonSetDevice(&vtxTramp); vtxCommonSetDevice(&vtxTramp);