1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Ignore CLI commands that are prefixed with # (comments)

This commit is contained in:
Dominic Clifton 2014-09-18 00:46:42 +01:00
parent e51cb447c4
commit d9d5227af9

View file

@ -1189,6 +1189,7 @@ void cliProcess(void)
cliPrint("\r\n"); cliPrint("\r\n");
cliBuffer[bufferIndex] = 0; // null terminate cliBuffer[bufferIndex] = 0; // null terminate
if (cliBuffer[0] != '#') {
target.name = cliBuffer; target.name = cliBuffer;
target.param = NULL; target.param = NULL;
@ -1197,6 +1198,7 @@ void cliProcess(void)
cmd->func(cliBuffer + strlen(cmd->name) + 1); cmd->func(cliBuffer + strlen(cmd->name) + 1);
else else
cliPrint("Unknown command, try 'help'"); cliPrint("Unknown command, try 'help'");
}
memset(cliBuffer, 0, sizeof(cliBuffer)); memset(cliBuffer, 0, sizeof(cliBuffer));
bufferIndex = 0; bufferIndex = 0;
@ -1204,6 +1206,7 @@ void cliProcess(void)
// 'exit' will reset this flag, so we don't need to print prompt again // 'exit' will reset this flag, so we don't need to print prompt again
if (!cliMode) if (!cliMode)
return; return;
cliPrompt(); cliPrompt();
} else if (c == 127) { } else if (c == 127) {
// backspace // backspace