1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-14 11:59:56 +03:00

Added PID Profiles to Programming framework

## Added PID Profiles to Programming framework
This allows setting the profile and getting the active profile in the programming framework.
This commit is contained in:
Darren Lines 2021-09-09 10:24:57 +01:00
parent 05629c8669
commit 51d5df1690
2 changed files with 17 additions and 1 deletions

View file

@ -34,6 +34,7 @@
#include "common/utils.h"
#include "rx/rx.h"
#include "common/maths.h"
#include "fc/config.h"
#include "fc/fc_core.h"
#include "fc/rc_controls.h"
#include "fc/runtime_config.h"
@ -333,6 +334,15 @@ static int logicConditionCompute(
}
break;
case LOGIC_CONDITION_SET_PID_PROFILE:
operandA--;
if ( getConfigProfile() != operandA && (operandA >= 0 && operandA < MAX_PROFILE_COUNT)) {
return setConfigProfile(operandA);
} else {
return false;
}
break;
default:
return false;
break;
@ -533,6 +543,10 @@ static int logicConditionGetFlightOperandValue(int operand) {
#endif
break;
case LOGIC_CONDITION_OPERAND_FLIGHT_PID_PROFILE: // int
return getConfigProfile() + 1;
break;
default:
return 0;
break;