mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 20:10:18 +03:00
Merge pull request #7747 from etracer65/fix_beacon_dump
Fix CLI beacon dump output
This commit is contained in:
commit
b1a63a0253
1 changed files with 10 additions and 9 deletions
|
@ -165,7 +165,6 @@ extern uint8_t __config_end;
|
|||
|
||||
#include "cli.h"
|
||||
|
||||
|
||||
static serialPort_t *cliPort;
|
||||
|
||||
#ifdef STM32F1
|
||||
|
@ -2969,10 +2968,11 @@ static void cliFeature(char *cmdline)
|
|||
}
|
||||
|
||||
#if defined(USE_BEEPER)
|
||||
static void printBeeper(uint8_t dumpMask, const uint32_t offFlags, const uint32_t offFlagsDefault, const char *name)
|
||||
static void printBeeper(uint8_t dumpMask, const uint32_t offFlags, const uint32_t offFlagsDefault, const char *name, const uint32_t allowedFlags)
|
||||
{
|
||||
const uint8_t beeperCount = beeperTableEntryCount();
|
||||
for (int32_t i = 0; i < beeperCount - 1; i++) {
|
||||
if (beeperModeMaskForTableIndex(i) & allowedFlags) {
|
||||
const char *formatOff = "%s -%s";
|
||||
const char *formatOn = "%s %s";
|
||||
const uint32_t beeperModeMask = beeperModeMaskForTableIndex(i);
|
||||
|
@ -2980,6 +2980,7 @@ static void printBeeper(uint8_t dumpMask, const uint32_t offFlags, const uint32_
|
|||
cliDumpPrintLinef(dumpMask, ~(offFlags ^ offFlagsDefault) & beeperModeMask, offFlags & beeperModeMask ? formatOff : formatOn, name, beeperNameForTableIndex(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void processBeeperCommand(char *cmdline, uint32_t *offFlags, const uint32_t allowedFlags)
|
||||
{
|
||||
|
@ -5351,11 +5352,11 @@ static void printConfig(char *cmdline, bool doDiff)
|
|||
|
||||
#if defined(USE_BEEPER)
|
||||
cliPrintHashLine("beeper");
|
||||
printBeeper(dumpMask, beeperConfig_Copy.beeper_off_flags, beeperConfig()->beeper_off_flags, "beeper");
|
||||
printBeeper(dumpMask, beeperConfig_Copy.beeper_off_flags, beeperConfig()->beeper_off_flags, "beeper", BEEPER_ALLOWED_MODES);
|
||||
|
||||
#if defined(USE_DSHOT)
|
||||
cliPrintHashLine("beacon");
|
||||
printBeeper(dumpMask, beeperConfig_Copy.dshotBeaconOffFlags, beeperConfig()->dshotBeaconOffFlags, "beacon");
|
||||
printBeeper(dumpMask, beeperConfig_Copy.dshotBeaconOffFlags, beeperConfig()->dshotBeaconOffFlags, "beacon", DSHOT_BEACON_ALLOWED_MODES);
|
||||
#endif
|
||||
#endif // USE_BEEPER
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue