mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 20:10:18 +03:00
Fix compile errors if USE_VTX_TABLE is not defined
This commit is contained in:
parent
12cc6dc683
commit
c2770087c3
2 changed files with 14 additions and 5 deletions
|
@ -2567,6 +2567,15 @@ static void cliVtx(char *cmdline)
|
||||||
if (isEmpty(cmdline)) {
|
if (isEmpty(cmdline)) {
|
||||||
printVtx(DUMP_MASTER, vtxConfig(), NULL, NULL);
|
printVtx(DUMP_MASTER, vtxConfig(), NULL, NULL);
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef USE_VTX_TABLE
|
||||||
|
const uint8_t maxBandIndex = vtxTableConfig()->bands;
|
||||||
|
const uint8_t maxChannelIndex = vtxTableConfig()->channels;
|
||||||
|
const uint8_t maxPowerIndex = vtxTableConfig()->powerLevels;
|
||||||
|
#else
|
||||||
|
const uint8_t maxBandIndex = VTX_TABLE_MAX_BANDS;
|
||||||
|
const uint8_t maxChannelIndex = VTX_TABLE_MAX_CHANNELS;
|
||||||
|
const uint8_t maxPowerIndex = VTX_TABLE_MAX_POWER_LEVELS;
|
||||||
|
#endif
|
||||||
ptr = cmdline;
|
ptr = cmdline;
|
||||||
i = atoi(ptr++);
|
i = atoi(ptr++);
|
||||||
if (i < MAX_CHANNEL_ACTIVATION_CONDITION_COUNT) {
|
if (i < MAX_CHANNEL_ACTIVATION_CONDITION_COUNT) {
|
||||||
|
@ -2583,7 +2592,7 @@ static void cliVtx(char *cmdline)
|
||||||
ptr = nextArg(ptr);
|
ptr = nextArg(ptr);
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
val = atoi(ptr);
|
val = atoi(ptr);
|
||||||
if (val >= 0 && val <= vtxTableConfig()->bands) {
|
if (val >= 0 && val <= maxBandIndex) {
|
||||||
cac->band = val;
|
cac->band = val;
|
||||||
validArgumentCount++;
|
validArgumentCount++;
|
||||||
}
|
}
|
||||||
|
@ -2591,7 +2600,7 @@ static void cliVtx(char *cmdline)
|
||||||
ptr = nextArg(ptr);
|
ptr = nextArg(ptr);
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
val = atoi(ptr);
|
val = atoi(ptr);
|
||||||
if (val >= 0 && val <= vtxTableConfig()->channels) {
|
if (val >= 0 && val <= maxChannelIndex) {
|
||||||
cac->channel = val;
|
cac->channel = val;
|
||||||
validArgumentCount++;
|
validArgumentCount++;
|
||||||
}
|
}
|
||||||
|
@ -2599,7 +2608,7 @@ static void cliVtx(char *cmdline)
|
||||||
ptr = nextArg(ptr);
|
ptr = nextArg(ptr);
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
val = atoi(ptr);
|
val = atoi(ptr);
|
||||||
if (val >= 0 && val <= vtxTableConfig()->powerLevels) {
|
if (val >= 0 && val <= maxPowerIndex) {
|
||||||
cac->power= val;
|
cac->power= val;
|
||||||
validArgumentCount++;
|
validArgumentCount++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,13 +130,13 @@ static uint8_t saLockMode = SA_MODE_SET_UNLOCK; // saCms variable?
|
||||||
|
|
||||||
#ifdef USE_VTX_TABLE
|
#ifdef USE_VTX_TABLE
|
||||||
#define VTX_SMARTAUDIO_POWER_COUNT VTX_TABLE_MAX_POWER_LEVELS
|
#define VTX_SMARTAUDIO_POWER_COUNT VTX_TABLE_MAX_POWER_LEVELS
|
||||||
static uint8_t saSupportedNumPowerLevels = VTX_SMARTAUDIO_POWER_COUNT;
|
|
||||||
static uint16_t saSupportedPowerValues[VTX_SMARTAUDIO_POWER_COUNT];
|
|
||||||
#else // USE_VTX_TABLE
|
#else // USE_VTX_TABLE
|
||||||
#define VTX_SMARTAUDIO_POWER_COUNT 4
|
#define VTX_SMARTAUDIO_POWER_COUNT 4
|
||||||
static char saSupportedPowerLabels[VTX_SMARTAUDIO_POWER_COUNT + 1][4] = {"---", "25 ", "200", "500", "800"};
|
static char saSupportedPowerLabels[VTX_SMARTAUDIO_POWER_COUNT + 1][4] = {"---", "25 ", "200", "500", "800"};
|
||||||
static char *saSupportedPowerLabelPointerArray[VTX_SMARTAUDIO_POWER_COUNT + 1];
|
static char *saSupportedPowerLabelPointerArray[VTX_SMARTAUDIO_POWER_COUNT + 1];
|
||||||
#endif // USE_VTX_TABLE
|
#endif // USE_VTX_TABLE
|
||||||
|
static uint8_t saSupportedNumPowerLevels = VTX_SMARTAUDIO_POWER_COUNT;
|
||||||
|
static uint16_t saSupportedPowerValues[VTX_SMARTAUDIO_POWER_COUNT];
|
||||||
|
|
||||||
// XXX Should be configurable by user?
|
// XXX Should be configurable by user?
|
||||||
bool saDeferred = true; // saCms variable?
|
bool saDeferred = true; // saCms variable?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue