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:
parent
05629c8669
commit
51d5df1690
2 changed files with 17 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue