mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-15 20:35:29 +03:00
Initial code
This commit is contained in:
parent
bce0cec406
commit
7e51f1ff5d
2 changed files with 14 additions and 3 deletions
|
@ -89,7 +89,8 @@ static int logicConditionCompute(
|
||||||
int32_t currentVaue,
|
int32_t currentVaue,
|
||||||
logicOperation_e operation,
|
logicOperation_e operation,
|
||||||
int32_t operandA,
|
int32_t operandA,
|
||||||
int32_t operandB
|
int32_t operandB,
|
||||||
|
timeMs_t *timeout
|
||||||
) {
|
) {
|
||||||
int temporaryValue;
|
int temporaryValue;
|
||||||
vtxDeviceCapability_t vtxDeviceCapability;
|
vtxDeviceCapability_t vtxDeviceCapability;
|
||||||
|
@ -162,6 +163,12 @@ static int logicConditionCompute(
|
||||||
return currentVaue;
|
return currentVaue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LOGIC_CONDITION_EDGE:
|
||||||
|
if (operandA && timeout == 0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case LOGIC_CONDITION_GVAR_SET:
|
case LOGIC_CONDITION_GVAR_SET:
|
||||||
gvSet(operandA, operandB);
|
gvSet(operandA, operandB);
|
||||||
return operandB;
|
return operandB;
|
||||||
|
@ -425,7 +432,8 @@ void logicConditionProcess(uint8_t i) {
|
||||||
logicConditionStates[i].value,
|
logicConditionStates[i].value,
|
||||||
logicConditions(i)->operation,
|
logicConditions(i)->operation,
|
||||||
operandAValue,
|
operandAValue,
|
||||||
operandBValue
|
operandBValue,
|
||||||
|
&logicConditionStates[i].timeout,
|
||||||
);
|
);
|
||||||
|
|
||||||
logicConditionStates[i].value = newValue;
|
logicConditionStates[i].value = newValue;
|
||||||
|
@ -786,6 +794,7 @@ void logicConditionReset(void) {
|
||||||
for (uint8_t i = 0; i < MAX_LOGIC_CONDITIONS; i++) {
|
for (uint8_t i = 0; i < MAX_LOGIC_CONDITIONS; i++) {
|
||||||
logicConditionStates[i].value = 0;
|
logicConditionStates[i].value = 0;
|
||||||
logicConditionStates[i].flags = 0;
|
logicConditionStates[i].flags = 0;
|
||||||
|
logicConditionStates[i].timeout = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,8 @@ typedef enum {
|
||||||
LOGIC_CONDITION_MAX = 44,
|
LOGIC_CONDITION_MAX = 44,
|
||||||
LOGIC_CONDITION_FLIGHT_AXIS_ANGLE_OVERRIDE = 45,
|
LOGIC_CONDITION_FLIGHT_AXIS_ANGLE_OVERRIDE = 45,
|
||||||
LOGIC_CONDITION_FLIGHT_AXIS_RATE_OVERRIDE = 46,
|
LOGIC_CONDITION_FLIGHT_AXIS_RATE_OVERRIDE = 46,
|
||||||
LOGIC_CONDITION_LAST = 47,
|
LOGIC_CONDITION_EDGE = 47,
|
||||||
|
LOGIC_CONDITION_LAST = 48,
|
||||||
} logicOperation_e;
|
} logicOperation_e;
|
||||||
|
|
||||||
typedef enum logicOperandType_s {
|
typedef enum logicOperandType_s {
|
||||||
|
@ -188,6 +189,7 @@ PG_DECLARE_ARRAY(logicCondition_t, MAX_LOGIC_CONDITIONS, logicConditions);
|
||||||
typedef struct logicConditionState_s {
|
typedef struct logicConditionState_s {
|
||||||
int value;
|
int value;
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
|
timeMs_t timeout;
|
||||||
} logicConditionState_t;
|
} logicConditionState_t;
|
||||||
|
|
||||||
typedef struct rcChannelOverride_s {
|
typedef struct rcChannelOverride_s {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue