vtx58_Freq2Bandchan to use vtxDevice_t parameters

This commit is contained in:
jflyper 2017-01-15 01:54:26 +09:00
parent cdd0cd4528
commit 12e265c006
2 changed files with 5 additions and 5 deletions

View File

@ -116,14 +116,14 @@ bool vtxCommonGetPitmode(uint8_t *pOnoff)
// Utilities // Utilities
bool vtx58_Freq2Bandchan(uint16_t freq, uint8_t *pBand, uint8_t *pChan) bool vtx58_Freq2Bandchan(vtxDevice_t *pVtxDev, uint16_t freq, uint8_t *pBand, uint8_t *pChan)
{ {
uint8_t band; uint8_t band;
uint8_t chan; uint8_t chan;
for (band = 0 ; band < 5 ; band++) { for (band = 0 ; band < pVtxDev->numBand ; band++) {
for (chan = 0 ; chan < 8 ; chan++) { for (chan = 0 ; chan < pVtxDev->numChan ; chan++) {
if (vtx58FreqTable[band][chan] == freq) { if (pVtxDev->freqTable[band * pVtxDev->numChan + chan] == freq) {
*pBand = band + 1; *pBand = band + 1;
*pChan = chan + 1; *pChan = chan + 1;
return true; return true;

View File

@ -79,4 +79,4 @@ bool vtxCommonGetBandChan(uint8_t *pBand, uint8_t *pChan);
bool vtxCommonGetPowerIndex(uint8_t *pIndex); bool vtxCommonGetPowerIndex(uint8_t *pIndex);
bool vtxCommonGetPitmode(uint8_t *pOnoff); bool vtxCommonGetPitmode(uint8_t *pOnoff);
bool vtx58_Freq2Bandchan(uint16_t freq, uint8_t *pBand, uint8_t *pChan); bool vtx58_Freq2Bandchan(vtxDevice_t *pVtxDev, uint16_t freq, uint8_t *pBand, uint8_t *pChan);