mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
Avoid error message appearing incorrectly after showing cli commands.
This commit is contained in:
parent
7e5eeb53b2
commit
81cf29be70
1 changed files with 8 additions and 1 deletions
|
@ -973,6 +973,7 @@ static void cliGet(char *cmdline)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
const clivalue_t *val;
|
const clivalue_t *val;
|
||||||
|
int matchedCommands = 0;
|
||||||
|
|
||||||
for (i = 0; i < VALUE_COUNT; i++) {
|
for (i = 0; i < VALUE_COUNT; i++) {
|
||||||
if (strstr(valueTable[i].name, cmdline)) {
|
if (strstr(valueTable[i].name, cmdline)) {
|
||||||
|
@ -980,10 +981,16 @@ static void cliGet(char *cmdline)
|
||||||
printf("%s = ", valueTable[i].name);
|
printf("%s = ", valueTable[i].name);
|
||||||
cliPrintVar(val, 0);
|
cliPrintVar(val, 0);
|
||||||
printf("\r\n");
|
printf("\r\n");
|
||||||
|
|
||||||
|
matchedCommands++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we get down here, then the variable was not found
|
|
||||||
|
if (matchedCommands) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cliPrint("ERR: Unknown variable name\r\n");
|
cliPrint("ERR: Unknown variable name\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue