mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
Display available dBm power levels from SA2.1 VTX along with corresponding power expressed in mW
This commit is contained in:
parent
887a913c6e
commit
938a39ac8f
8 changed files with 91 additions and 7 deletions
|
@ -1598,8 +1598,8 @@ static void cliAdjustmentRange(char *cmdline)
|
|||
ptr = nextArg(ptr);
|
||||
if (ptr) {
|
||||
val = atoi(ptr);
|
||||
// Was: slot
|
||||
// Keeping the parameter to retain backwards compatibility for the command format.
|
||||
// Was: slot
|
||||
// Keeping the parameter to retain backwards compatibility for the command format.
|
||||
validArgumentCount++;
|
||||
}
|
||||
ptr = nextArg(ptr);
|
||||
|
@ -2993,6 +2993,29 @@ static void cliVtxTable(char *cmdline)
|
|||
cliPrintErrorLinef("INVALID SUBCOMMAND %s", tok);
|
||||
}
|
||||
}
|
||||
|
||||
static void cliVtxInfo(char *cmdline)
|
||||
{
|
||||
UNUSED(cmdline);
|
||||
|
||||
// Display the available power levels
|
||||
uint16_t levels[VTX_TABLE_MAX_POWER_LEVELS];
|
||||
uint16_t powers[VTX_TABLE_MAX_POWER_LEVELS];
|
||||
vtxDevice_t *vtxDevice = vtxCommonDevice();
|
||||
if (vtxDevice) {
|
||||
uint8_t level_count = vtxCommonGetVTXPowerLevels(vtxDevice, levels, powers);
|
||||
|
||||
if (level_count) {
|
||||
for (int i = 0; i < level_count; i++) {
|
||||
cliPrintLinef("level %d dBm, power %d mW", levels[i], powers[i]);
|
||||
}
|
||||
} else {
|
||||
cliPrintErrorLinef("NO POWER VALUES DEFINED");
|
||||
}
|
||||
} else {
|
||||
cliPrintErrorLinef("NO VTX");
|
||||
}
|
||||
}
|
||||
#endif // USE_VTX_TABLE
|
||||
|
||||
static void printName(dumpFlags_t dumpMask, const pilotConfig_t *pilotConfig)
|
||||
|
@ -5832,7 +5855,7 @@ static void cliResource(char *cmdline)
|
|||
return;
|
||||
}
|
||||
|
||||
const char * resourceName = ownerNames[resourceTable[resourceIndex].owner];
|
||||
const char * resourceName = ownerNames[resourceTable[resourceIndex].owner];
|
||||
if (strncasecmp(pch, resourceName, strlen(resourceName)) == 0) {
|
||||
break;
|
||||
}
|
||||
|
@ -6370,6 +6393,7 @@ const clicmd_t cmdTable[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef USE_VTX_TABLE
|
||||
CLI_COMMAND_DEF("vtx_info", "vtx power config dump", NULL, cliVtxInfo),
|
||||
CLI_COMMAND_DEF("vtxtable", "vtx frequency table", "<band> <bandname> <bandletter> [FACTORY|CUSTOM] <freq> ... <freq>\r\n", cliVtxTable),
|
||||
#endif
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue