1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

Fix compile errors if USE_VTX_TABLE is not defined

This commit is contained in:
Bruce Luckcuck 2020-01-27 09:07:20 -05:00
parent 12cc6dc683
commit c2770087c3
2 changed files with 14 additions and 5 deletions

View file

@ -2567,6 +2567,15 @@ static void cliVtx(char *cmdline)
if (isEmpty(cmdline)) {
printVtx(DUMP_MASTER, vtxConfig(), NULL, NULL);
} 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;
i = atoi(ptr++);
if (i < MAX_CHANNEL_ACTIVATION_CONDITION_COUNT) {
@ -2583,7 +2592,7 @@ static void cliVtx(char *cmdline)
ptr = nextArg(ptr);
if (ptr) {
val = atoi(ptr);
if (val >= 0 && val <= vtxTableConfig()->bands) {
if (val >= 0 && val <= maxBandIndex) {
cac->band = val;
validArgumentCount++;
}
@ -2591,7 +2600,7 @@ static void cliVtx(char *cmdline)
ptr = nextArg(ptr);
if (ptr) {
val = atoi(ptr);
if (val >= 0 && val <= vtxTableConfig()->channels) {
if (val >= 0 && val <= maxChannelIndex) {
cac->channel = val;
validArgumentCount++;
}
@ -2599,7 +2608,7 @@ static void cliVtx(char *cmdline)
ptr = nextArg(ptr);
if (ptr) {
val = atoi(ptr);
if (val >= 0 && val <= vtxTableConfig()->powerLevels) {
if (val >= 0 && val <= maxPowerIndex) {
cac->power= val;
validArgumentCount++;
}