mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
Whitespace cleanup and simplification of delay for serial cli F4 support
This commit is contained in:
parent
df11d398aa
commit
1b73a8f2aa
1 changed files with 10 additions and 30 deletions
|
@ -826,7 +826,7 @@ const clivalue_t valueTable[] = {
|
||||||
{ "pid_max_velocity", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.pidMaxVelocity, .config.minmax = {0, 2000 } },
|
{ "pid_max_velocity", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.pidMaxVelocity, .config.minmax = {0, 2000 } },
|
||||||
{ "pid_max_velocity_yaw", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.pidMaxVelocityYaw, .config.minmax = {0, 2000 } },
|
{ "pid_max_velocity_yaw", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.pidMaxVelocityYaw, .config.minmax = {0, 2000 } },
|
||||||
|
|
||||||
{ "iterm_ignore_threshold", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.rollPitchItermIgnoreRate, .config.minmax = {15, 1000 } },
|
{ "iterm_ignore_threshold", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.rollPitchItermIgnoreRate, .config.minmax = {15, 1000 } },
|
||||||
{ "yaw_iterm_ignore_threshold", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.yawItermIgnoreRate, .config.minmax = {15, 1000 } },
|
{ "yaw_iterm_ignore_threshold", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.yawItermIgnoreRate, .config.minmax = {15, 1000 } },
|
||||||
{ "yaw_lowpass", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.yaw_lpf_hz, .config.minmax = {0, 500 } },
|
{ "yaw_lowpass", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.yaw_lpf_hz, .config.minmax = {0, 500 } },
|
||||||
{ "pid_process_denom", VAR_UINT8 | MASTER_VALUE, &masterConfig.pid_process_denom, .config.minmax = { 1, 8 } },
|
{ "pid_process_denom", VAR_UINT8 | MASTER_VALUE, &masterConfig.pid_process_denom, .config.minmax = { 1, 8 } },
|
||||||
|
@ -2009,11 +2009,6 @@ static void dumpValues(uint16_t valueSection)
|
||||||
cliPrintf("set %s = ", valueTable[i].name);
|
cliPrintf("set %s = ", valueTable[i].name);
|
||||||
cliPrintVar(value, 0);
|
cliPrintVar(value, 0);
|
||||||
cliPrint("\r\n");
|
cliPrint("\r\n");
|
||||||
|
|
||||||
#ifdef USE_SLOW_SERIAL_CLI
|
|
||||||
delay(2);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2058,7 +2053,7 @@ static void cliDump(char *cmdline)
|
||||||
cliPrint("\r\n# version\r\n");
|
cliPrint("\r\n# version\r\n");
|
||||||
cliVersion(NULL);
|
cliVersion(NULL);
|
||||||
|
|
||||||
printSectionBreak();
|
printSectionBreak();
|
||||||
cliPrint("\r\n# name\r\n");
|
cliPrint("\r\n# name\r\n");
|
||||||
cliName(NULL);
|
cliName(NULL);
|
||||||
|
|
||||||
|
@ -2089,9 +2084,6 @@ static void cliDump(char *cmdline)
|
||||||
if (yaw < 0)
|
if (yaw < 0)
|
||||||
cliWrite(' ');
|
cliWrite(' ');
|
||||||
cliPrintf("%s\r\n", ftoa(yaw, buf));
|
cliPrintf("%s\r\n", ftoa(yaw, buf));
|
||||||
#ifdef USE_SLOW_SERIAL_CLI
|
|
||||||
delay(2);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_SERVOS
|
#ifdef USE_SERVOS
|
||||||
|
@ -2113,10 +2105,6 @@ static void cliDump(char *cmdline)
|
||||||
masterConfig.customServoMixer[i].max,
|
masterConfig.customServoMixer[i].max,
|
||||||
masterConfig.customServoMixer[i].box
|
masterConfig.customServoMixer[i].box
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef USE_SLOW_SERIAL_CLI
|
|
||||||
delay(2);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2128,18 +2116,12 @@ static void cliDump(char *cmdline)
|
||||||
if (featureNames[i] == NULL)
|
if (featureNames[i] == NULL)
|
||||||
break;
|
break;
|
||||||
cliPrintf("feature -%s\r\n", featureNames[i]);
|
cliPrintf("feature -%s\r\n", featureNames[i]);
|
||||||
#ifdef USE_SLOW_SERIAL_CLI
|
|
||||||
delay(2);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
for (i = 0; ; i++) { // reenable what we want.
|
for (i = 0; ; i++) { // reenable what we want.
|
||||||
if (featureNames[i] == NULL)
|
if (featureNames[i] == NULL)
|
||||||
break;
|
break;
|
||||||
if (mask & (1 << i))
|
if (mask & (1 << i))
|
||||||
cliPrintf("feature %s\r\n", featureNames[i]);
|
cliPrintf("feature %s\r\n", featureNames[i]);
|
||||||
#ifdef USE_SLOW_SERIAL_CLI
|
|
||||||
delay(2);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BEEPER
|
#ifdef BEEPER
|
||||||
|
@ -2194,9 +2176,6 @@ static void cliDump(char *cmdline)
|
||||||
for (channel = 0; channel < INPUT_SOURCE_COUNT; channel++) {
|
for (channel = 0; channel < INPUT_SOURCE_COUNT; channel++) {
|
||||||
if (servoDirection(i, channel) < 0) {
|
if (servoDirection(i, channel) < 0) {
|
||||||
cliPrintf("smix reverse %d %d r\r\n", i , channel);
|
cliPrintf("smix reverse %d %d r\r\n", i , channel);
|
||||||
#ifdef USE_SLOW_SERIAL_CLI
|
|
||||||
delay(2);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2227,9 +2206,6 @@ static void cliDump(char *cmdline)
|
||||||
cliPrint("\r\n# restore original rateprofile selection\r\n");
|
cliPrint("\r\n# restore original rateprofile selection\r\n");
|
||||||
changeControlRateProfile(currentRateIndex);
|
changeControlRateProfile(currentRateIndex);
|
||||||
cliRateProfile("");
|
cliRateProfile("");
|
||||||
#ifdef USE_SLOW_SERIAL_CLI
|
|
||||||
delay(2);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cliPrint("\r\n# restore original profile selection\r\n");
|
cliPrint("\r\n# restore original profile selection\r\n");
|
||||||
|
@ -2710,6 +2686,10 @@ static void cliPrint(const char *str)
|
||||||
{
|
{
|
||||||
while (*str)
|
while (*str)
|
||||||
bufWriterAppend(cliWriter, *str++);
|
bufWriterAppend(cliWriter, *str++);
|
||||||
|
|
||||||
|
#ifdef USE_SLOW_SERIAL_CLI
|
||||||
|
delay(1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cliPutp(void *p, char ch)
|
static void cliPutp(void *p, char ch)
|
||||||
|
@ -2723,6 +2703,10 @@ static void cliPrintf(const char *fmt, ...)
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
tfp_format(cliWriter, cliPutp, fmt, va);
|
tfp_format(cliWriter, cliPutp, fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
|
#ifdef USE_SLOW_SERIAL_CLI
|
||||||
|
delay(1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cliWrite(uint8_t ch)
|
static void cliWrite(uint8_t ch)
|
||||||
|
@ -2856,10 +2840,6 @@ static void cliSet(char *cmdline)
|
||||||
cliPrintf("%s = ", valueTable[i].name);
|
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
|
cliPrintVar(val, len); // when len is 1 (when * is passed as argument), it will print min/max values as well, for gui
|
||||||
cliPrint("\r\n");
|
cliPrint("\r\n");
|
||||||
|
|
||||||
#ifdef USE_SLOW_SERIAL_CLI
|
|
||||||
delay(2);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
} else if ((eqptr = strstr(cmdline, "=")) != NULL) {
|
} else if ((eqptr = strstr(cmdline, "=")) != NULL) {
|
||||||
// has equals
|
// has equals
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue