mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
Minor updates to naming the craft
This commit is contained in:
parent
2fb3ee0192
commit
d65f7a0383
3 changed files with 5 additions and 13 deletions
|
@ -2500,18 +2500,12 @@ static void cliMotor(char *cmdline)
|
|||
|
||||
static void cliName(char *cmdline)
|
||||
{
|
||||
|
||||
uint32_t len = strlen(cmdline);
|
||||
if (len == 0) {
|
||||
cliPrintf("name %s\r\n", masterConfig.name);
|
||||
} else if ('-' == cmdline[0]) {
|
||||
memset(masterConfig.name, '\0', MAX_NAME_LENGTH);
|
||||
cliPrintf("name removed\r\n");
|
||||
} else {
|
||||
memset(masterConfig.name, '\0', MAX_NAME_LENGTH);
|
||||
if (len > 0) {
|
||||
memset(masterConfig.name, 0, ARRAYLEN(masterConfig.name));
|
||||
strncpy(masterConfig.name, cmdline, MIN(len, MAX_NAME_LENGTH));
|
||||
cliPrintf("name %s\r\n", masterConfig.name);
|
||||
}
|
||||
cliPrintf("name %s\r\n", strlen(masterConfig.name) > 0 ? masterConfig.name : "-");
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue