mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
cliPrintLinefeed() is the consensus?
This commit is contained in:
parent
2034895b27
commit
8007303df3
1 changed files with 30 additions and 30 deletions
|
@ -187,7 +187,7 @@ static void cliPrint(const char *str)
|
|||
bufWriterFlush(cliWriter);
|
||||
}
|
||||
|
||||
static void cliPrintBlankLine()
|
||||
static void cliPrintLinefeed()
|
||||
{
|
||||
cliPrint("\r\n");
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ static void cliPrintBlankLine()
|
|||
static void cliPrintLine(const char *str)
|
||||
{
|
||||
cliPrint(str);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
#ifdef MINIMAL_CLI
|
||||
|
@ -233,7 +233,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, ...)
|
||||
|
@ -382,11 +382,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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -423,7 +423,7 @@ static void cliPrintVarRange(const clivalue_t *var)
|
|||
cliPrint(",");
|
||||
cliPrintf(" %s", tableEntry->values[i]);
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ static void cliRepeat(char ch, uint8_t len)
|
|||
for (int i = 0; i < len; i++) {
|
||||
bufWriterAppend(cliWriter, ch);
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1492,7 +1492,7 @@ static void printServoMix(uint8_t dumpMask, const servoMixer_t *customServoMixer
|
|||
);
|
||||
}
|
||||
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
static void cliServoMix(char *cmdline)
|
||||
|
@ -1534,13 +1534,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;
|
||||
}
|
||||
|
@ -1673,7 +1673,7 @@ static void cliSdInfo(char *cmdline)
|
|||
}
|
||||
break;
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1710,7 +1710,7 @@ static void cliFlashErase(char *cmdline)
|
|||
cliPrintf(".");
|
||||
if (i++ > 120) {
|
||||
i=0;
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
bufWriterFlush(cliWriter);
|
||||
|
@ -1718,7 +1718,7 @@ static void cliFlashErase(char *cmdline)
|
|||
delay(100);
|
||||
}
|
||||
beeper(BEEPER_BLACKBOX_ERASE);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
cliPrintLine("Done.");
|
||||
}
|
||||
|
||||
|
@ -1769,7 +1769,7 @@ static void cliFlashRead(char *cmdline)
|
|||
break;
|
||||
}
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1920,7 +1920,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++) {
|
||||
|
@ -1928,7 +1928,7 @@ static void cliFeature(char *cmdline)
|
|||
break;
|
||||
cliPrintf(" %s", featureNames[i]);
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
return;
|
||||
} else {
|
||||
bool remove = false;
|
||||
|
@ -2005,12 +2005,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;
|
||||
|
@ -2315,7 +2315,7 @@ static void cliMixer(char *cmdline)
|
|||
break;
|
||||
cliPrintf(" %s", mixerNames[i]);
|
||||
}
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2450,7 +2450,7 @@ static void cliDumpPidProfile(uint8_t pidProfileIndex, uint8_t dumpMask)
|
|||
changePidProfile(pidProfileIndex);
|
||||
cliPrintHashLine("profile");
|
||||
cliProfile("");
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
dumpAllValues(PROFILE_VALUE, dumpMask);
|
||||
}
|
||||
|
||||
|
@ -2463,7 +2463,7 @@ static void cliDumpRateProfile(uint8_t rateProfileIndex, uint8_t dumpMask)
|
|||
changeControlRateProfile(rateProfileIndex);
|
||||
cliPrintHashLine("rateprofile");
|
||||
cliRateProfile("");
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
dumpAllValues(PROFILE_RATE_VALUE, dumpMask);
|
||||
}
|
||||
|
||||
|
@ -2495,9 +2495,9 @@ static void cliGet(char *cmdline)
|
|||
val = &valueTable[i];
|
||||
cliPrintf("%s = ", valueTable[i].name);
|
||||
cliPrintVar(val, 0);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
cliPrintVarRange(val);
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
|
||||
matchedCommands++;
|
||||
}
|
||||
|
@ -2525,7 +2525,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
|
||||
|
@ -2619,7 +2619,7 @@ static void cliStatus(char *cmdline)
|
|||
}
|
||||
}
|
||||
#endif /* USE_SENSOR_NAMES */
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
|
||||
#ifdef USE_SDCARD
|
||||
cliSdInfo(NULL);
|
||||
|
@ -2866,10 +2866,10 @@ static void cliResource(char *cmdline)
|
|||
if (ioRecs[i].index > 0) {
|
||||
cliPrintf(" %d", ioRecs[i].index);
|
||||
}
|
||||
cliPrint("\r\n");
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
|
||||
#ifdef MINIMAL_CLI
|
||||
cliPrintLine("DMA:");
|
||||
|
@ -3032,7 +3032,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");
|
||||
|
@ -3288,7 +3288,7 @@ static void cliHelp(char *cmdline)
|
|||
cliPrintf("\r\n\t%s", cmdTable[i].args);
|
||||
}
|
||||
#endif
|
||||
cliPrintBlankLine();
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3348,7 +3348,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