mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-15 04:15:38 +03:00
Update logic_condition.c
Reinitialise PID and filters if the profile has changed.
This commit is contained in:
parent
4ef43e1125
commit
282ac5b1aa
1 changed files with 7 additions and 1 deletions
|
@ -337,7 +337,13 @@ static int logicConditionCompute(
|
|||
case LOGIC_CONDITION_SET_PID_PROFILE:
|
||||
operandA--;
|
||||
if ( getConfigProfile() != operandA && (operandA >= 0 && operandA < MAX_PROFILE_COUNT)) {
|
||||
return setConfigProfile(operandA);
|
||||
bool profileChanged = false;
|
||||
if (setConfigProfile(operandA)) {
|
||||
pidInit();
|
||||
pidInitFilters();
|
||||
profileChanged = true;
|
||||
}
|
||||
return profileChanged;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue