mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 11:59:58 +03:00
Merge pull request #7516 from mikeller/add_automatic_pid_profile_switching
Added battery cell count based automatic PID profile switching.
This commit is contained in:
commit
59ea4becb3
23 changed files with 124 additions and 73 deletions
|
@ -3674,7 +3674,7 @@ static void cliProfile(char *cmdline)
|
|||
return;
|
||||
} else {
|
||||
const int i = atoi(cmdline);
|
||||
if (i >= 0 && i < MAX_PROFILE_COUNT) {
|
||||
if (i >= 0 && i < PID_PROFILE_COUNT) {
|
||||
changePidProfile(i);
|
||||
cliProfile("");
|
||||
} else {
|
||||
|
@ -3701,7 +3701,7 @@ static void cliRateProfile(char *cmdline)
|
|||
|
||||
static void cliDumpPidProfile(uint8_t pidProfileIndex, uint8_t dumpMask)
|
||||
{
|
||||
if (pidProfileIndex >= MAX_PROFILE_COUNT) {
|
||||
if (pidProfileIndex >= PID_PROFILE_COUNT) {
|
||||
// Faulty values
|
||||
return;
|
||||
}
|
||||
|
@ -5118,7 +5118,7 @@ static void printConfig(char *cmdline, bool doDiff)
|
|||
dumpAllValues(MASTER_VALUE, dumpMask);
|
||||
|
||||
if (dumpMask & DUMP_ALL) {
|
||||
for (uint32_t pidProfileIndex = 0; pidProfileIndex < MAX_PROFILE_COUNT; pidProfileIndex++) {
|
||||
for (uint32_t pidProfileIndex = 0; pidProfileIndex < PID_PROFILE_COUNT; pidProfileIndex++) {
|
||||
cliDumpPidProfile(pidProfileIndex, dumpMask);
|
||||
}
|
||||
cliPrintHashLine("restore original profile selection");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue