mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Touch-ups
This commit is contained in:
parent
1d8018f547
commit
f565138101
12 changed files with 14 additions and 110 deletions
4
Makefile
4
Makefile
|
@ -591,7 +591,6 @@ HIGHEND_SRC = \
|
||||||
drivers/serial_escserial.c \
|
drivers/serial_escserial.c \
|
||||||
drivers/serial_softserial.c \
|
drivers/serial_softserial.c \
|
||||||
drivers/sonar_hcsr04.c \
|
drivers/sonar_hcsr04.c \
|
||||||
drivers/vtx_var.c \
|
|
||||||
drivers/vtx_common.c \
|
drivers/vtx_common.c \
|
||||||
flight/navigation.c \
|
flight/navigation.c \
|
||||||
flight/gps_conversion.c \
|
flight/gps_conversion.c \
|
||||||
|
@ -614,7 +613,7 @@ HIGHEND_SRC = \
|
||||||
telemetry/mavlink.c \
|
telemetry/mavlink.c \
|
||||||
telemetry/ibus.c \
|
telemetry/ibus.c \
|
||||||
sensors/esc_sensor.c \
|
sensors/esc_sensor.c \
|
||||||
io/vtx_common.c \
|
io/vtx_string.c \
|
||||||
io/vtx_smartaudio.c \
|
io/vtx_smartaudio.c \
|
||||||
io/vtx_tramp.c
|
io/vtx_tramp.c
|
||||||
|
|
||||||
|
@ -708,7 +707,6 @@ SPEED_OPTIMISED_SRC := $(SPEED_OPTIMISED_SRC) \
|
||||||
|
|
||||||
SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
|
SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
|
||||||
drivers/serial_escserial.c \
|
drivers/serial_escserial.c \
|
||||||
drivers/vtx_var.c \
|
|
||||||
drivers/vtx_common.c \
|
drivers/vtx_common.c \
|
||||||
io/cli.c \
|
io/cli.c \
|
||||||
io/serial_4way.c \
|
io/serial_4way.c \
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#if defined(VTX_COMMON)
|
#if defined(VTX_COMMON)
|
||||||
|
|
||||||
#include "vtx_common.h"
|
#include "vtx_common.h"
|
||||||
#include "vtx_var.h"
|
|
||||||
|
|
||||||
vtxDevice_t *vtxDevice = NULL;
|
vtxDevice_t *vtxDevice = NULL;
|
||||||
|
|
||||||
|
@ -122,28 +121,4 @@ bool vtxCommonGetPitmode(uint8_t *pOnoff)
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Utilities
|
|
||||||
|
|
||||||
bool vtx58_Freq2Bandchan(vtxDevice_t *pVtxDev, uint16_t freq, uint8_t *pBand, uint8_t *pChan)
|
|
||||||
{
|
|
||||||
uint8_t band;
|
|
||||||
uint8_t chan;
|
|
||||||
|
|
||||||
for (band = 0 ; band < pVtxDev->numBand ; band++) {
|
|
||||||
for (chan = 0 ; chan < pVtxDev->numChan ; chan++) {
|
|
||||||
if (pVtxDev->freqTable[band * pVtxDev->numChan + chan] == freq) {
|
|
||||||
*pBand = band + 1;
|
|
||||||
*pChan = chan + 1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*pBand = 0;
|
|
||||||
*pChan = 0;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -81,6 +81,3 @@ void vtxCommonSetPitmode(uint8_t onoff);
|
||||||
bool vtxCommonGetBandChan(uint8_t *pBand, uint8_t *pChan);
|
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);
|
||||||
|
|
||||||
// Utilities
|
|
||||||
bool vtx58_Freq2Bandchan(vtxDevice_t *pVtxDev, uint16_t freq, uint8_t *pBand, uint8_t *pChan);
|
|
||||||
|
|
|
@ -87,7 +87,9 @@
|
||||||
#define DISABLE_RTC6705 GPIO_SetBits(RTC6705_CS_GPIO, RTC6705_CS_PIN)
|
#define DISABLE_RTC6705 GPIO_SetBits(RTC6705_CS_GPIO, RTC6705_CS_PIN)
|
||||||
#define ENABLE_RTC6705 GPIO_ResetBits(RTC6705_CS_GPIO, RTC6705_CS_PIN)
|
#define ENABLE_RTC6705 GPIO_ResetBits(RTC6705_CS_GPIO, RTC6705_CS_PIN)
|
||||||
|
|
||||||
|
#if defined(SPRACINGF3NEO)
|
||||||
static IO_t vtxPowerPin = IO_NONE;
|
static IO_t vtxPowerPin = IO_NONE;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ENABLE_VTX_POWER IOLo(vtxPowerPin)
|
#define ENABLE_VTX_POWER IOLo(vtxPowerPin)
|
||||||
#define DISABLE_VTX_POWER IOHi(vtxPowerPin)
|
#define DISABLE_VTX_POWER IOHi(vtxPowerPin)
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
/*
|
|
||||||
* This file is part of Cleanflight.
|
|
||||||
*
|
|
||||||
* Cleanflight is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Cleanflight is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Created by jflyper */
|
|
||||||
|
|
||||||
#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",
|
|
||||||
};
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* This file is part of Cleanflight.
|
|
||||||
*
|
|
||||||
* Cleanflight is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Cleanflight is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Created by jflyper */
|
|
||||||
|
|
||||||
#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[];
|
|
|
@ -53,6 +53,7 @@
|
||||||
#include "io/osd.h"
|
#include "io/osd.h"
|
||||||
#include "io/serial.h"
|
#include "io/serial.h"
|
||||||
#include "io/transponder_ir.h"
|
#include "io/transponder_ir.h"
|
||||||
|
#include "io/vtx_tramp.h" // Will be gone
|
||||||
|
|
||||||
#include "msp/msp_serial.h"
|
#include "msp/msp_serial.h"
|
||||||
|
|
||||||
|
@ -215,6 +216,7 @@ void taskVtxControl(uint32_t currentTime)
|
||||||
#ifdef VTX_COMMON
|
#ifdef VTX_COMMON
|
||||||
vtxCommonProcess(currentTime);
|
vtxCommonProcess(currentTime);
|
||||||
#endif
|
#endif
|
||||||
|
// Call to trampProcess() will be gone
|
||||||
#ifdef VTX_TRAMP
|
#ifdef VTX_TRAMP
|
||||||
trampProcess(currentTime);
|
trampProcess(currentTime);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -33,11 +33,10 @@
|
||||||
#include "common/utils.h"
|
#include "common/utils.h"
|
||||||
#include "drivers/system.h"
|
#include "drivers/system.h"
|
||||||
#include "drivers/serial.h"
|
#include "drivers/serial.h"
|
||||||
#include "drivers/vtx_var.h"
|
|
||||||
#include "drivers/vtx_common.h"
|
#include "drivers/vtx_common.h"
|
||||||
#include "io/serial.h"
|
#include "io/serial.h"
|
||||||
#include "io/vtx_smartaudio.h"
|
#include "io/vtx_smartaudio.h"
|
||||||
#include "io/vtx_common.h"
|
#include "io/vtx_string.h"
|
||||||
|
|
||||||
#include "fc/rc_controls.h"
|
#include "fc/rc_controls.h"
|
||||||
#include "fc/runtime_config.h"
|
#include "fc/runtime_config.h"
|
||||||
|
@ -86,7 +85,7 @@ static vtxDevice_t vtxSmartAudio = {
|
||||||
.numChan = 8,
|
.numChan = 8,
|
||||||
.numPower = 4,
|
.numPower = 4,
|
||||||
.bandNames = (char **)vtx58BandNames,
|
.bandNames = (char **)vtx58BandNames,
|
||||||
.chanNames = (char **)vtx58ChanNames,
|
.chanNames = (char **)vtx58ChannelNames,
|
||||||
.powerNames = (char **)saPowerNames,
|
.powerNames = (char **)saPowerNames,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -1124,7 +1123,7 @@ static CMS_Menu saCmsMenuStats = {
|
||||||
|
|
||||||
static OSD_TAB_t saCmsEntBand = { &saCmsBand, 5, vtx58BandNames, NULL };
|
static OSD_TAB_t saCmsEntBand = { &saCmsBand, 5, vtx58BandNames, NULL };
|
||||||
|
|
||||||
static OSD_TAB_t saCmsEntChan = { &saCmsChan, 8, vtx58ChanNames, NULL };
|
static OSD_TAB_t saCmsEntChan = { &saCmsChan, 8, vtx58ChannelNames, NULL };
|
||||||
|
|
||||||
static const char * const saCmsPowerNames[] = {
|
static const char * const saCmsPowerNames[] = {
|
||||||
"---",
|
"---",
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "build/debug.h"
|
#include "build/debug.h"
|
||||||
|
|
||||||
#if defined(VTX_CONTROL)
|
#if defined(VTX_COMMON)
|
||||||
|
|
||||||
const uint16_t vtx58FreqTable[5][8] =
|
const uint16_t vtx58FreqTable[5][8] =
|
||||||
{
|
{
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#if defined(VTX_CONTROL)
|
#if defined(VTX_COMMON)
|
||||||
|
|
||||||
extern const uint16_t vtx58FreqTable[5][8];
|
extern const uint16_t vtx58FreqTable[5][8];
|
||||||
extern const char * const vtx58BandNames[];
|
extern const char * const vtx58BandNames[];
|
|
@ -35,7 +35,7 @@
|
||||||
#include "drivers/serial.h"
|
#include "drivers/serial.h"
|
||||||
#include "drivers/system.h"
|
#include "drivers/system.h"
|
||||||
#include "io/vtx_tramp.h"
|
#include "io/vtx_tramp.h"
|
||||||
#include "io/vtx_common.h"
|
#include "io/vtx_string.h"
|
||||||
|
|
||||||
static serialPort_t *trampSerialPort = NULL;
|
static serialPort_t *trampSerialPort = NULL;
|
||||||
|
|
||||||
|
|
|
@ -22,4 +22,7 @@
|
||||||
// Targets with built-in vtx do not need external vtx
|
// Targets with built-in vtx do not need external vtx
|
||||||
#if defined(VTX) || defined(USE_RTC6705)
|
#if defined(VTX) || defined(USE_RTC6705)
|
||||||
# undef VTX_CONTROL
|
# undef VTX_CONTROL
|
||||||
|
# undef VTX_COMMON
|
||||||
|
# undef VTX_SMARTAUDIO
|
||||||
|
# undef VTX_TRAMP
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue