Print names instead of hex value
This commit is contained in:
parent
740b4a91bd
commit
42ba069a69
|
@ -2712,9 +2712,16 @@ static void cliStatus(char *cmdline)
|
|||
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);
|
||||
#ifdef MINIMAL_CLI
|
||||
cliPrintLinef("0x%x", getArmingDisableFlags() & ~ARMING_DISABLED_CLI);
|
||||
cliPrintLinef("Arming disable flags: 0x%x", getArmingDisableFlags());
|
||||
#else
|
||||
cliPrintLinef("Arming disable flags: 0x%x", getArmingDisableFlags() & ~ARMING_DISABLED_CLI);
|
||||
cliPrint("Arming disable flags:");
|
||||
uint16_t flags = getArmingDisableFlags();
|
||||
while (flags) {
|
||||
int bitpos = ffs(flags) - 1;
|
||||
flags &= ~(1 << bitpos);
|
||||
cliPrintf(" %s", armingDisableFlagNames[bitpos]);
|
||||
}
|
||||
cliPrintLinefeed();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include "fc/runtime_config.h"
|
||||
#include "io/beeper.h"
|
||||
|
||||
const char *armingDisableFlagNames[] = { ARMING_DISBALED_FLAG_NAMES };
|
||||
|
||||
uint8_t armingFlags = 0;
|
||||
uint8_t stateFlags = 0;
|
||||
uint16_t flightModeFlags = 0;
|
||||
|
|
|
@ -47,6 +47,21 @@ typedef enum {
|
|||
ARMING_DISABLED_BST = (1 << 10),
|
||||
} armingDisableFlags_e;
|
||||
|
||||
extern const char *armingDisableFlagNames[];
|
||||
|
||||
#define ARMING_DISBALED_FLAG_NAMES \
|
||||
"NOGYRO", \
|
||||
"FAILSAFE", \
|
||||
"BOXFAILSAFE", \
|
||||
"THROTTLE", \
|
||||
"ANGLE", \
|
||||
"LOAD", \
|
||||
"CALIB", \
|
||||
"CLI", \
|
||||
"CMS", \
|
||||
"OSD", \
|
||||
"BST",
|
||||
|
||||
void setArmingDisabled(armingDisableFlags_e flag);
|
||||
void unsetArmingDisabled(armingDisableFlags_e flag);
|
||||
bool isArmingDisabled(void);
|
||||
|
|
Loading…
Reference in New Issue