diff --git a/src/main/common/logic_condition.c b/src/main/common/logic_condition.c index 202aa8359e..be1421ace2 100644 --- a/src/main/common/logic_condition.c +++ b/src/main/common/logic_condition.c @@ -108,6 +108,26 @@ int logicConditionCompute( return operandA > 1666; break; + case LOGIC_CONDITION_AND: + return (operandA && operandB); + break; + + case LOGIC_CONDITION_OR: + return (operandA || operandB); + break; + + case LOGIC_CONDITION_XOR: + return (operandA != operandB); + break; + + case LOGIC_CONDITION_NAND: + return !(operandA && operandB); + break; + + case LOGIC_CONDITION_NOR: + return !(operandA || operandB); + break; + default: return false; break; diff --git a/src/main/common/logic_condition.h b/src/main/common/logic_condition.h index c4b6ea222a..e2ddbc6049 100644 --- a/src/main/common/logic_condition.h +++ b/src/main/common/logic_condition.h @@ -36,6 +36,11 @@ typedef enum { LOGIC_CONDITION_LOW, // 4 LOGIC_CONDITION_MID, // 5 LOGIC_CONDITION_HIGH, // 6 + LOGIC_CONDITION_AND, // 7 + LOGIC_CONDITION_OR, // 8 + LOGIC_CONDITION_XOR, // 9 + LOGIC_CONDITION_NAND, // 10 + LOGIC_CONDITION_NOR, // 11 LOGIC_CONDITION_LAST } logicOperation_e;