1
0
Fork 0
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:
Darren Lines 2021-09-16 08:11:18 +01:00
parent 4ef43e1125
commit 282ac5b1aa

View file

@ -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;
}