mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Added commands to restore profile / rateprofile selection to output of 'dump all' CLI command. Also added command to save config to 'dump all' output.
This commit is contained in:
parent
90bc67e2cc
commit
4e178629e0
1 changed files with 13 additions and 4 deletions
|
@ -1977,8 +1977,16 @@ static void cliDump(char *cmdline)
|
||||||
cliDumpRateProfile(rateCount);
|
cliDumpRateProfile(rateCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cliPrint("\r\n# restore original profile / rateprofile selection\r\n");
|
||||||
|
|
||||||
changeProfile(activeProfile);
|
changeProfile(activeProfile);
|
||||||
|
cliProfile("");
|
||||||
|
printSectionBreak();
|
||||||
|
|
||||||
changeControlRateProfile(currentRateIndex);
|
changeControlRateProfile(currentRateIndex);
|
||||||
|
cliRateProfile("");
|
||||||
|
|
||||||
|
cliPrint("\r\n# save configuration\r\nsave\r\n");
|
||||||
} else {
|
} else {
|
||||||
cliDumpProfile(masterConfig.current_profile_index);
|
cliDumpProfile(masterConfig.current_profile_index);
|
||||||
cliDumpRateProfile(currentProfile->activeRateProfile);
|
cliDumpRateProfile(currentProfile->activeRateProfile);
|
||||||
|
@ -2003,24 +2011,25 @@ void cliDumpProfile(uint8_t profileIndex) {
|
||||||
cliPrint("\r\n# profile\r\n");
|
cliPrint("\r\n# profile\r\n");
|
||||||
cliProfile("");
|
cliProfile("");
|
||||||
cliPrintf("############################# PROFILE VALUES ####################################\r\n");
|
cliPrintf("############################# PROFILE VALUES ####################################\r\n");
|
||||||
cliProfile("");
|
|
||||||
printSectionBreak();
|
printSectionBreak();
|
||||||
dumpValues(PROFILE_VALUE);
|
dumpValues(PROFILE_VALUE);
|
||||||
|
|
||||||
cliRateProfile("");
|
cliRateProfile("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void cliDumpRateProfile(uint8_t rateProfileIndex) {
|
void cliDumpRateProfile(uint8_t rateProfileIndex) {
|
||||||
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();
|
printSectionBreak();
|
||||||
|
|
||||||
dumpValues(PROFILE_RATE_VALUE);
|
dumpValues(PROFILE_RATE_VALUE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cliEnter(serialPort_t *serialPort)
|
void cliEnter(serialPort_t *serialPort)
|
||||||
{
|
{
|
||||||
cliMode = 1;
|
cliMode = 1;
|
||||||
|
@ -2397,7 +2406,7 @@ static void cliRateProfile(char *cmdline) {
|
||||||
i = atoi(cmdline);
|
i = atoi(cmdline);
|
||||||
if (i >= 0 && i < MAX_RATEPROFILES) {
|
if (i >= 0 && i < MAX_RATEPROFILES) {
|
||||||
changeControlRateProfile(i);
|
changeControlRateProfile(i);
|
||||||
cliRateProfile("");
|
cliRateProfile("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue