mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-14 11:59:56 +03:00
Add modulus operator support
This commit is contained in:
parent
ee06203151
commit
2eecf30603
3 changed files with 33 additions and 23 deletions
|
@ -193,6 +193,14 @@ static int logicConditionCompute(
|
|||
return operandA;
|
||||
}
|
||||
break;
|
||||
|
||||
case LOGIC_CONDITION_MODULUS:
|
||||
if (operandB != 0) {
|
||||
return constrain(operandA % operandB, INT16_MIN, INT16_MAX);
|
||||
} else {
|
||||
return operandA;
|
||||
}
|
||||
break;
|
||||
|
||||
case LOGIC_CONDITION_OVERRIDE_ARMING_SAFETY:
|
||||
LOGIC_CONDITION_GLOBAL_FLAG_ENABLE(LOGIC_CONDITION_GLOBAL_FLAG_OVERRIDE_ARMING_SAFETY);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue