1
0
Fork 0
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:
Michael Keller 2019-02-08 09:28:07 +13:00 committed by GitHub
commit 59ea4becb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 124 additions and 73 deletions

View file

@ -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");