Skip to content

Commit

Permalink
Fix compile errors if USE_VTX_TABLE is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
etracer65 committed Jan 27, 2020
1 parent 12cc6dc commit c277008
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
15 changes: 12 additions & 3 deletions src/main/cli/cli.c
Expand Up @@ -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) {
Expand All @@ -2583,23 +2592,23 @@ 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++;
}
}
ptr = nextArg(ptr);
if (ptr) {
val = atoi(ptr);
if (val >= 0 && val <= vtxTableConfig()->channels) {
if (val >= 0 && val <= maxChannelIndex) {
cac->channel = val;
validArgumentCount++;
}
}
ptr = nextArg(ptr);
if (ptr) {
val = atoi(ptr);
if (val >= 0 && val <= vtxTableConfig()->powerLevels) {
if (val >= 0 && val <= maxPowerIndex) {
cac->power= val;
validArgumentCount++;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/io/vtx_smartaudio.c
Expand Up @@ -130,13 +130,13 @@ static uint8_t saLockMode = SA_MODE_SET_UNLOCK; // saCms variable?

#ifdef USE_VTX_TABLE
#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
#define VTX_SMARTAUDIO_POWER_COUNT 4
static char saSupportedPowerLabels[VTX_SMARTAUDIO_POWER_COUNT + 1][4] = {"---", "25 ", "200", "500", "800"};
static char *saSupportedPowerLabelPointerArray[VTX_SMARTAUDIO_POWER_COUNT + 1];
#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?
bool saDeferred = true; // saCms variable?
Expand Down

0 comments on commit c277008

Please sign in to comment.