1
0
Fork 0
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:
Mingchen Zhang 2021-03-11 08:12:49 +00:00
parent ee06203151
commit 2eecf30603
3 changed files with 33 additions and 23 deletions

View file

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