mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Use arming flag names in CLI whenever possible
Some targets define both MINIMAL_CLI and OSD, in this case the arming disable flan name strings are present but unused for the CLI. Match the test in the cli.c with that in runtime_config.[ch] so that the flag names are used whenever they are included.
This commit is contained in:
parent
b67dcdbeb2
commit
646d757460
1 changed files with 4 additions and 3 deletions
|
@ -3013,9 +3013,8 @@ static void cliStatus(char *cmdline)
|
||||||
const int systemRate = getTaskDeltaTime(TASK_SYSTEM) == 0 ? 0 : (int)(1000000.0f / ((float)getTaskDeltaTime(TASK_SYSTEM)));
|
const int systemRate = getTaskDeltaTime(TASK_SYSTEM) == 0 ? 0 : (int)(1000000.0f / ((float)getTaskDeltaTime(TASK_SYSTEM)));
|
||||||
cliPrintLinef("CPU:%d%%, cycle time: %d, GYRO rate: %d, RX rate: %d, System rate: %d",
|
cliPrintLinef("CPU:%d%%, cycle time: %d, GYRO rate: %d, RX rate: %d, System rate: %d",
|
||||||
constrain(averageSystemLoadPercent, 0, 100), getTaskDeltaTime(TASK_GYROPID), gyroRate, rxRate, systemRate);
|
constrain(averageSystemLoadPercent, 0, 100), getTaskDeltaTime(TASK_GYROPID), gyroRate, rxRate, systemRate);
|
||||||
#ifdef MINIMAL_CLI
|
#if defined(OSD) || !defined(MINIMAL_CLI)
|
||||||
cliPrintLinef("Arming disable flags: 0x%x", getArmingDisableFlags());
|
/* Flag strings are present if OSD is compiled so may as well use them even with MINIMAL_CLI */
|
||||||
#else
|
|
||||||
cliPrint("Arming disable flags:");
|
cliPrint("Arming disable flags:");
|
||||||
uint16_t flags = getArmingDisableFlags();
|
uint16_t flags = getArmingDisableFlags();
|
||||||
while (flags) {
|
while (flags) {
|
||||||
|
@ -3024,6 +3023,8 @@ static void cliStatus(char *cmdline)
|
||||||
cliPrintf(" %s", armingDisableFlagNames[bitpos]);
|
cliPrintf(" %s", armingDisableFlagNames[bitpos]);
|
||||||
}
|
}
|
||||||
cliPrintLinefeed();
|
cliPrintLinefeed();
|
||||||
|
#else
|
||||||
|
cliPrintLinef("Arming disable flags: 0x%x", getArmingDisableFlags());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue