auto-sync
This commit is contained in:
parent
e1ffcfd569
commit
ce4920c421
|
@ -38,6 +38,9 @@ static LENameOrdinalPair leMoreOrEqual(LE_OPERATOR_MORE_OR_EQUAL, ">=");
|
|||
static LENameOrdinalPair leLess(LE_OPERATOR_LESS, "<");
|
||||
static LENameOrdinalPair leLessOrEquals(LE_OPERATOR_LESS_OR_EQUAL, "<=");
|
||||
|
||||
static LENameOrdinalPair leMax(LE_METHOD_MAX, "max");
|
||||
static LENameOrdinalPair leMin(LE_METHOD_MIN, "min");
|
||||
|
||||
#define LE_EVAL_POOL_SIZE 32
|
||||
|
||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
|
@ -202,6 +205,19 @@ void LECalculator::doJob(Engine *engine, LEElement *element) {
|
|||
stack.push(v1 >= v2);
|
||||
}
|
||||
break;
|
||||
case LE_METHOD_MAX: {
|
||||
float v2 = pop(LE_METHOD_MAX);
|
||||
float v1 = pop(LE_METHOD_MAX);
|
||||
stack.push(maxF(v1, v2));
|
||||
}
|
||||
break;
|
||||
case LE_METHOD_MIN: {
|
||||
float v2 = pop(LE_METHOD_MIN);
|
||||
float v1 = pop(LE_METHOD_MIN);
|
||||
stack.push(minF(v1, v2));
|
||||
}
|
||||
break;
|
||||
|
||||
case LE_UNDEFINED:
|
||||
firmwareError("Undefined not expected here");
|
||||
break;
|
||||
|
|
|
@ -27,6 +27,8 @@ typedef enum {
|
|||
LE_OPERATOR_SUBSTRACTION = 10,
|
||||
LE_OPERATOR_MULTIPLICATION = 11,
|
||||
LE_OPERATOR_DIVISION = 12,
|
||||
LE_METHOD_MAX = 13,
|
||||
LE_METHOD_MIN = 14,
|
||||
|
||||
LE_METHOD_RPM = 100,
|
||||
LE_METHOD_COOLANT = 101,
|
||||
|
|
|
@ -470,7 +470,7 @@ void initEngineContoller(Engine *engine) {
|
|||
}
|
||||
}
|
||||
|
||||
addConsoleActionSSP("set_user_out", (VoidCharPtrCharPtrVoidPtr) setUserOutput, engine);
|
||||
addConsoleActionSSP("set_fsio", (VoidCharPtrCharPtrVoidPtr) setUserOutput, engine);
|
||||
addConsoleActionSS("set_float", (VoidCharPtrCharPtr) setFloat);
|
||||
addConsoleActionSS("set_int", (VoidCharPtrCharPtr) setInt);
|
||||
addConsoleActionI("get_float", getFloat);
|
||||
|
|
|
@ -42,6 +42,10 @@ float maxF(float i1, float i2) {
|
|||
return i1 > i2 ? i1 : i2;
|
||||
}
|
||||
|
||||
float minF(float i1, float i2) {
|
||||
return i1 < i2 ? i1 : i2;
|
||||
}
|
||||
|
||||
uint32_t efiStrlen(const char *param) {
|
||||
register const char *s;
|
||||
for (s = param; *s; ++s)
|
||||
|
|
|
@ -51,6 +51,7 @@ float efiRound(float value, float precision);
|
|||
int maxI(int i1, int i2);
|
||||
int minI(int i1, int i2);
|
||||
float maxF(float i1, float i2);
|
||||
float minF(float i1, float i2);
|
||||
char* itoa10(char *p, int num);
|
||||
bool isSameF(float v1, float v2);
|
||||
|
||||
|
|
|
@ -168,6 +168,9 @@ void testLogicExpressions(void) {
|
|||
testExpression("fan not coolant 90 > and", 1);
|
||||
|
||||
|
||||
testExpression("10 99 max", 99);
|
||||
|
||||
|
||||
testExpression("fan NOT coolant 90 > AND fan coolant 85 > AND OR", 1);
|
||||
|
||||
mockRpm = 900;
|
||||
|
|
Loading…
Reference in New Issue