mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 08:45:36 +03:00
Merge pull request #2922 from jflyper/bfdev-fix-resource-command-output
Fix resource command outputs
This commit is contained in:
commit
0a37e76a37
1 changed files with 34 additions and 34 deletions
|
@ -188,7 +188,7 @@ static void cliPrint(const char *str)
|
|||
bufWriterFlush(cliWriter);
|
||||
}
|
||||
|
||||
static void cliPrintBlankLine()
|
||||
static void cliPrintLinefeed()
|
||||
{
|
||||
cliPrint("\r\n");
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ static void cliPrintBlankLine()
|
|||
static void cliPrintLine(const char *str)
|
||||
{
|
||||
cliPrint(str);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
#ifdef MINIMAL_CLI
|
||||
|
@ -234,7 +234,7 @@ static void cliPrintLinefva(const char *format, va_list va)
|
|||
{
|
||||
tfp_format(cliWriter, cliPutp, format, va);
|
||||
bufWriterFlush(cliWriter);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
static bool cliDumpPrintLinef(uint8_t dumpMask, bool equalsDefault, const char *format, ...)
|
||||
|
@ -377,11 +377,11 @@ static void dumpPgValue(const clivalue_t *value, uint8_t dumpMask)
|
|||
if (dumpMask & SHOW_DEFAULTS && !equalsDefault) {
|
||||
cliPrintf(defaultFormat, value->name);
|
||||
printValuePointer(value, (uint8_t*)pg->address + valueOffset, 0);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
cliPrintf(format, value->name);
|
||||
printValuePointer(value, (uint8_t*)pg->copy + valueOffset, 0);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -418,7 +418,7 @@ static void cliPrintVarRange(const clivalue_t *var)
|
|||
cliPrint(",");
|
||||
cliPrintf(" %s", tableEntry->values[i]);
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ static void cliRepeat(char ch, uint8_t len)
|
|||
for (int i = 0; i < len; i++) {
|
||||
bufWriterAppend(cliWriter, ch);
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1484,7 +1484,7 @@ static void printServoMix(uint8_t dumpMask, const servoMixer_t *customServoMixer
|
|||
);
|
||||
}
|
||||
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
static void cliServoMix(char *cmdline)
|
||||
|
@ -1526,13 +1526,13 @@ static void cliServoMix(char *cmdline)
|
|||
cliPrintf("s");
|
||||
for (uint32_t inputSource = 0; inputSource < INPUT_SOURCE_COUNT; inputSource++)
|
||||
cliPrintf("\ti%d", inputSource);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
|
||||
for (uint32_t servoIndex = 0; servoIndex < MAX_SUPPORTED_SERVOS; servoIndex++) {
|
||||
cliPrintf("%d", servoIndex);
|
||||
for (uint32_t inputSource = 0; inputSource < INPUT_SOURCE_COUNT; inputSource++)
|
||||
cliPrintf("\t%s ", (servoParams(servoIndex)->reversedSources & (1 << inputSource)) ? "r" : "n");
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1665,7 +1665,7 @@ static void cliSdInfo(char *cmdline)
|
|||
}
|
||||
break;
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1702,7 +1702,7 @@ static void cliFlashErase(char *cmdline)
|
|||
cliPrintf(".");
|
||||
if (i++ > 120) {
|
||||
i=0;
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
bufWriterFlush(cliWriter);
|
||||
|
@ -1710,7 +1710,7 @@ static void cliFlashErase(char *cmdline)
|
|||
delay(100);
|
||||
}
|
||||
beeper(BEEPER_BLACKBOX_ERASE);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
cliPrintLine("Done.");
|
||||
}
|
||||
|
||||
|
@ -1761,7 +1761,7 @@ static void cliFlashRead(char *cmdline)
|
|||
break;
|
||||
}
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1912,7 +1912,7 @@ static void cliFeature(char *cmdline)
|
|||
if (mask & (1 << i))
|
||||
cliPrintf("%s ", featureNames[i]);
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
} else if (strncasecmp(cmdline, "list", len) == 0) {
|
||||
cliPrint("Available:");
|
||||
for (uint32_t i = 0; ; i++) {
|
||||
|
@ -1920,7 +1920,7 @@ static void cliFeature(char *cmdline)
|
|||
break;
|
||||
cliPrintf(" %s", featureNames[i]);
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
return;
|
||||
} else {
|
||||
bool remove = false;
|
||||
|
@ -1997,12 +1997,12 @@ static void cliBeeper(char *cmdline)
|
|||
if (mask & (1 << i))
|
||||
cliPrintf(" %s", beeperNameForTableIndex(i));
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
} else if (strncasecmp(cmdline, "list", len) == 0) {
|
||||
cliPrint("Available:");
|
||||
for (uint32_t i = 0; i < beeperCount; i++)
|
||||
cliPrintf(" %s", beeperNameForTableIndex(i));
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
return;
|
||||
} else {
|
||||
bool remove = false;
|
||||
|
@ -2307,7 +2307,7 @@ static void cliMixer(char *cmdline)
|
|||
break;
|
||||
cliPrintf(" %s", mixerNames[i]);
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2442,7 +2442,7 @@ static void cliDumpPidProfile(uint8_t pidProfileIndex, uint8_t dumpMask)
|
|||
changePidProfile(pidProfileIndex);
|
||||
cliPrintHashLine("profile");
|
||||
cliProfile("");
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
dumpAllValues(PROFILE_VALUE, dumpMask);
|
||||
}
|
||||
|
||||
|
@ -2455,7 +2455,7 @@ static void cliDumpRateProfile(uint8_t rateProfileIndex, uint8_t dumpMask)
|
|||
changeControlRateProfile(rateProfileIndex);
|
||||
cliPrintHashLine("rateprofile");
|
||||
cliRateProfile("");
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
dumpAllValues(PROFILE_RATE_VALUE, dumpMask);
|
||||
}
|
||||
|
||||
|
@ -2487,9 +2487,9 @@ static void cliGet(char *cmdline)
|
|||
val = &valueTable[i];
|
||||
cliPrintf("%s = ", valueTable[i].name);
|
||||
cliPrintVar(val, 0);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
cliPrintVarRange(val);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
|
||||
matchedCommands++;
|
||||
}
|
||||
|
@ -2517,7 +2517,7 @@ static void cliSet(char *cmdline)
|
|||
val = &valueTable[i];
|
||||
cliPrintf("%s = ", valueTable[i].name);
|
||||
cliPrintVar(val, len); // when len is 1 (when * is passed as argument), it will print min/max values as well, for gui
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
} else if ((eqptr = strstr(cmdline, "=")) != NULL) {
|
||||
// has equals
|
||||
|
@ -2611,7 +2611,7 @@ static void cliStatus(char *cmdline)
|
|||
}
|
||||
}
|
||||
#endif /* USE_SENSOR_NAMES */
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
|
||||
#ifdef USE_SDCARD
|
||||
cliSdInfo(NULL);
|
||||
|
@ -2772,7 +2772,7 @@ static void printResource(uint8_t dumpMask)
|
|||
const ioTag_t ioTagDefault = *((const ioTag_t *)defaultConfig + resourceTable[i].offset + index);
|
||||
|
||||
bool equalsDefault = ioTag == ioTagDefault;
|
||||
const char *format = "resource %s %d %c%02dn";
|
||||
const char *format = "resource %s %d %c%02d";
|
||||
const char *formatUnassigned = "resource %s %d NONE";
|
||||
if (!ioTagDefault) {
|
||||
cliDefaultPrintLinef(dumpMask, equalsDefault, formatUnassigned, owner, RESOURCE_INDEX(index));
|
||||
|
@ -2854,15 +2854,15 @@ static void cliResource(char *cmdline)
|
|||
const char* owner;
|
||||
owner = ownerNames[ioRecs[i].owner];
|
||||
|
||||
cliPrintf("%c%02d: %s ", IO_GPIOPortIdx(ioRecs + i) + 'A', IO_GPIOPinIdx(ioRecs + i), owner);
|
||||
cliPrintf("%c%02d: %s", IO_GPIOPortIdx(ioRecs + i) + 'A', IO_GPIOPinIdx(ioRecs + i), owner);
|
||||
if (ioRecs[i].index > 0) {
|
||||
cliPrintf("%d", ioRecs[i].index);
|
||||
cliPrintf(" %d", ioRecs[i].index);
|
||||
}
|
||||
cliPrintLine("\r\n");
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
cliPrintLine("\r\n");
|
||||
cliPrintLine("\r\n");
|
||||
cliPrintLinefeed();
|
||||
|
||||
#ifdef MINIMAL_CLI
|
||||
cliPrintLine("DMA:");
|
||||
#else
|
||||
|
@ -3024,7 +3024,7 @@ static void printConfig(char *cmdline, bool doDiff)
|
|||
if ((dumpMask & (DUMP_ALL | DO_DIFF)) == (DUMP_ALL | DO_DIFF)) {
|
||||
cliPrintHashLine("reset configuration to default settings");
|
||||
cliPrint("defaults");
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
cliPrintHashLine("name");
|
||||
|
@ -3280,7 +3280,7 @@ static void cliHelp(char *cmdline)
|
|||
cliPrintf("\r\n\t%s", cmdTable[i].args);
|
||||
}
|
||||
#endif
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3340,7 +3340,7 @@ void cliProcess(void)
|
|||
cliPrompt();
|
||||
} else if (bufferIndex && (c == '\n' || c == '\r')) {
|
||||
// enter pressed
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
|
||||
// Strip comment starting with # from line
|
||||
char *p = cliBuffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue