1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

cleanup cli commands outputs and over

- deleted printSectionBreak and his #define (not more used)
- cleaned cli commads output (dump, sd_info, version)
This commit is contained in:
TheAngularity 2016-08-09 19:53:18 +02:00 committed by GitHub
parent 5bee67eee5
commit a396ba0c11

View file

@ -927,7 +927,6 @@ const clivalue_t valueTable[] = {
#define VALUE_COUNT (sizeof(valueTable) / sizeof(clivalue_t)) #define VALUE_COUNT (sizeof(valueTable) / sizeof(clivalue_t))
typedef union { typedef union {
int32_t int_value; int32_t int_value;
float float_value; float float_value;
@ -940,8 +939,6 @@ static void cliPrint(const char *str);
static void cliPrintf(const char *fmt, ...); static void cliPrintf(const char *fmt, ...);
static void cliWrite(uint8_t ch); static void cliWrite(uint8_t ch);
#define printSectionBreak() cliPrintf((char *)sectionBreak)
#define COMPARE_CONFIG(value) (masterConfig.value == defaultConfig.value) #define COMPARE_CONFIG(value) (masterConfig.value == defaultConfig.value)
static bool cliDumpPrintf(uint8_t dumpMask, bool equalsDefault, const char *format, ...); static bool cliDumpPrintf(uint8_t dumpMask, bool equalsDefault, const char *format, ...);
@ -1731,8 +1728,6 @@ static void printServo(uint8_t dumpMask, master_t *defaultConfig)
); );
} }
printSectionBreak();
// print servo directions // print servo directions
unsigned int channel; unsigned int channel;
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) { for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
@ -2022,10 +2017,9 @@ static void cliSdInfo(char *cmdline) {
; // Nothing more detailed to print ; // Nothing more detailed to print
break; break;
} }
cliPrint("\r\n");
break; break;
} }
cliPrint("\r\n");
} }
#endif #endif
@ -2326,14 +2320,12 @@ static void printConfig(char *cmdline, bool doDiff)
if ((dumpMask & DUMP_MASTER) || (dumpMask & DUMP_ALL)) { if ((dumpMask & DUMP_MASTER) || (dumpMask & DUMP_ALL)) {
cliPrint("\r\n# version\r\n"); cliPrint("\r\n# version\r\n");
cliVersion(NULL); cliVersion(NULL);
cliPrint("\r\n");
if ((dumpMask & (DUMP_ALL | DO_DIFF)) == (DUMP_ALL | DO_DIFF)) { if ((dumpMask & (DUMP_ALL | DO_DIFF)) == (DUMP_ALL | DO_DIFF)) {
cliPrint("\r\n# reset configuration to default settings\r\ndefaults\r\n"); cliPrint("\r\n# reset configuration to default settings\r\ndefaults\r\n");
} }
printSectionBreak(); cliPrint("\r\n# name\r\n");
cliPrint("# name\r\n");
printName(dumpMask); printName(dumpMask);
cliPrint("\r\n# mixer\r\n"); cliPrint("\r\n# mixer\r\n");
@ -2460,7 +2452,7 @@ static void printConfig(char *cmdline, bool doDiff)
cliPrint("\r\n# adjrange\r\n"); cliPrint("\r\n# adjrange\r\n");
printAdjustmentRange(dumpMask, &defaultConfig); printAdjustmentRange(dumpMask, &defaultConfig);
cliPrintf("\r\n# rxrange\r\n"); cliPrint("\r\n# rxrange\r\n");
printRxRange(dumpMask, &defaultConfig); printRxRange(dumpMask, &defaultConfig);
#ifdef USE_SERVOS #ifdef USE_SERVOS
@ -2519,26 +2511,19 @@ static void cliDumpProfile(uint8_t profileIndex, uint8_t dumpMask, master_t *def
{ {
if (profileIndex >= MAX_PROFILE_COUNT) // Faulty values if (profileIndex >= MAX_PROFILE_COUNT) // Faulty values
return; return;
changeProfile(profileIndex); changeProfile(profileIndex);
cliPrint("\r\n# profile\r\n"); cliPrint("\r\n# profile\r\n");
cliProfile(""); cliProfile("");
printSectionBreak();
dumpValues(PROFILE_VALUE, dumpMask, defaultConfig); dumpValues(PROFILE_VALUE, dumpMask, defaultConfig);
cliRateProfile("");
} }
static void cliDumpRateProfile(uint8_t rateProfileIndex, uint8_t dumpMask, master_t *defaultConfig) static void cliDumpRateProfile(uint8_t rateProfileIndex, uint8_t dumpMask, master_t *defaultConfig)
{ {
if (rateProfileIndex >= MAX_RATEPROFILES) // Faulty values if (rateProfileIndex >= MAX_RATEPROFILES) // Faulty values
return; return;
changeControlRateProfile(rateProfileIndex); changeControlRateProfile(rateProfileIndex);
cliPrint("\r\n# rateprofile\r\n"); cliPrint("\r\n# rateprofile\r\n");
cliRateProfile(""); cliRateProfile("");
printSectionBreak();
dumpValues(PROFILE_RATE_VALUE, dumpMask, defaultConfig); dumpValues(PROFILE_RATE_VALUE, dumpMask, defaultConfig);
} }
@ -3338,7 +3323,7 @@ static void cliVersion(char *cmdline)
{ {
UNUSED(cmdline); UNUSED(cmdline);
cliPrintf("# BetaFlight/%s %s %s / %s (%s)", cliPrintf("# BetaFlight/%s %s %s / %s (%s)\r\n",
targetName, targetName,
FC_VERSION_STRING, FC_VERSION_STRING,
buildDate, buildDate,