auto-sync
This commit is contained in:
parent
b07e12be58
commit
b99fe9345e
|
@ -367,6 +367,9 @@ void setMiata1994_s(engine_configuration_s *engineConfiguration, board_configura
|
|||
boardConfiguration->injectionPins[1] = GPIOE_2; // injector #2
|
||||
boardConfiguration->injectionPins[2] = GPIOB_8; // injector #3
|
||||
boardConfiguration->injectionPins[3] = GPIOB_7; // injector #4
|
||||
|
||||
boardConfiguration->fsioPins[0] = GPIOD_11;
|
||||
strcpy(boardConfiguration->le_formulas[0], "coolant 80 >");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,9 +26,10 @@ static LENameOrdinalPair leAcToggle(LE_METHOD_AC_TOGGLE, "ac_on_switch");
|
|||
static LENameOrdinalPair leFanOnSetting(LE_METHOD_FAN_ON_SETTING, "fan_on_setting");
|
||||
static LENameOrdinalPair leFanOffSetting(LE_METHOD_FAN_OFF_SETTING, "fan_off_setting");
|
||||
static LENameOrdinalPair leTimeSinceBoot(LE_METHOD_TIME_SINCE_BOOT, "time_since_boot");
|
||||
static LENameOrdinalPair leFsioSsetting(LE_METHOD_FSIO_SETTING, "fsio_setting");
|
||||
|
||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
float getLEValue(Engine *engine, le_action_e action) {
|
||||
float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action) {
|
||||
efiAssert(engine!=NULL, "getLEValue", NAN);
|
||||
switch (action) {
|
||||
case LE_METHOD_FAN:
|
||||
|
|
|
@ -28,6 +28,6 @@
|
|||
*/
|
||||
#define FAN_CONTROL_LOGIC "fan coolant fan_off_setting > & coolant fan_on_setting > OR"
|
||||
|
||||
float getLEValue(Engine *engine, le_action_e action);
|
||||
float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action);
|
||||
|
||||
#endif /* LE_FUNCTIONS_H_ */
|
||||
|
|
|
@ -157,7 +157,7 @@ void LECalculator::doJob(Engine *engine, LEElement *element) {
|
|||
|
||||
stack.push(v1 > v2);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case LE_OPERATOR_ADDITION: {
|
||||
// elements on stack are in reverse order
|
||||
float v2 = pop(LE_OPERATOR_MORE);
|
||||
|
@ -165,7 +165,7 @@ void LECalculator::doJob(Engine *engine, LEElement *element) {
|
|||
|
||||
stack.push(v1 + v2);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case LE_OPERATOR_SUBSTRACTION: {
|
||||
// elements on stack are in reverse order
|
||||
float v2 = pop(LE_OPERATOR_MORE);
|
||||
|
@ -173,7 +173,7 @@ void LECalculator::doJob(Engine *engine, LEElement *element) {
|
|||
|
||||
stack.push(v1 - v2);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case LE_OPERATOR_MULTIPLICATION: {
|
||||
// elements on stack are in reverse order
|
||||
float v2 = pop(LE_OPERATOR_MORE);
|
||||
|
@ -181,7 +181,7 @@ void LECalculator::doJob(Engine *engine, LEElement *element) {
|
|||
|
||||
stack.push(v1 * v2);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case LE_OPERATOR_DIVISION: {
|
||||
// elements on stack are in reverse order
|
||||
float v2 = pop(LE_OPERATOR_MORE);
|
||||
|
@ -213,25 +213,34 @@ void LECalculator::doJob(Engine *engine, LEElement *element) {
|
|||
float vCond = pop(LE_METHOD_IF);
|
||||
stack.push(vCond != 0 ? vTrue : vFalse);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case LE_METHOD_MAX: {
|
||||
float v2 = pop(LE_METHOD_MAX);
|
||||
float v1 = pop(LE_METHOD_MAX);
|
||||
stack.push(maxF(v1, v2));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case LE_METHOD_MIN: {
|
||||
float v2 = pop(LE_METHOD_MIN);
|
||||
float v1 = pop(LE_METHOD_MIN);
|
||||
stack.push(minF(v1, v2));
|
||||
}
|
||||
break;
|
||||
|
||||
break;
|
||||
case LE_METHOD_FSIO_SETTING: {
|
||||
float i = pop(LE_METHOD_FSIO_SETTING);
|
||||
int index = (int) i;
|
||||
if (index >= 0 && index < LE_COMMAND_COUNT) {
|
||||
stack.push(engine->engineConfiguration->bc.fsio_setting[index]);
|
||||
} else {
|
||||
stack.push(NAN);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LE_UNDEFINED:
|
||||
firmwareError("Undefined not expected here");
|
||||
break;
|
||||
default:
|
||||
stack.push(getLEValue(engine, element->action));
|
||||
stack.push(getLEValue(engine, &stack, element->action));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ typedef enum {
|
|||
LE_METHOD_INTAKE_AIR = 108,
|
||||
LE_METHOD_VBATT = 109,
|
||||
LE_METHOD_AC_TOGGLE = 110,
|
||||
LE_METHOD_FSIO_SETTING = 111,
|
||||
|
||||
Force_4b_le_action = ENUM_SIZE_HACK,
|
||||
|
||||
|
@ -76,6 +77,8 @@ private:
|
|||
|
||||
#define MAX_STACK_DEPTH 32
|
||||
|
||||
typedef FLStack<float, MAX_STACK_DEPTH> calc_stack_t;
|
||||
|
||||
class LECalculator {
|
||||
public:
|
||||
LECalculator();
|
||||
|
@ -89,7 +92,7 @@ private:
|
|||
void doJob(Engine *engine, LEElement *element);
|
||||
float pop(le_action_e action);
|
||||
LEElement *first;
|
||||
FLStack<float, MAX_STACK_DEPTH> stack;
|
||||
calc_stack_t stack;
|
||||
};
|
||||
|
||||
class LENameOrdinalPair {
|
||||
|
|
|
@ -21,7 +21,7 @@ static float mockFan;
|
|||
static float mockRpm;
|
||||
static float mockTimeSinceBoot;
|
||||
|
||||
float getLEValue(Engine *engine, le_action_e action) {
|
||||
float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action) {
|
||||
switch(action) {
|
||||
case LE_METHOD_FAN:
|
||||
return mockFan;
|
||||
|
|
Loading…
Reference in New Issue