remove specs_s struct, flatten config
(cherry picked from commit f090a97b0b
)
This commit is contained in:
parent
ecbc8bc8e4
commit
2857e9527d
|
@ -140,8 +140,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -180,8 +180,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -183,8 +183,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -137,8 +137,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 2;
|
||||
engineConfiguration->specs.firingOrder = FO_1_2;
|
||||
engineConfiguration->cylindersCount = 2;
|
||||
engineConfiguration->firingOrder = FO_1_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -106,8 +106,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -131,8 +131,8 @@ void setBoardDefaultConfiguration() {
|
|||
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_VAG);
|
||||
strcpy(engineConfiguration->engineCode, "base");
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -179,9 +179,9 @@ void setBoardDefaultConfiguration() {
|
|||
|
||||
engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->specs.displacement = 1.998;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->displacement = 1.998;
|
||||
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_Hyundai);
|
||||
strcpy(engineConfiguration->engineCode, "Theta II");
|
||||
engineConfiguration->globalTriggerAngleOffset = 90;
|
||||
|
|
|
@ -107,8 +107,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -123,8 +123,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -120,8 +120,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -109,8 +109,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
|
||||
|
|
|
@ -201,8 +201,8 @@ void setBoardDefaultConfiguration() {
|
|||
// Don't enable expansion header SPI by default
|
||||
engineConfiguration->is_enabled_spi_3 = false;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
|
|
|
@ -171,8 +171,8 @@ void setBoardDefaultConfiguration() {
|
|||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
engineConfiguration->specs.firingOrder = FO_1_8_7_2_6_5_4_3;
|
||||
engineConfiguration->cylindersCount = 8;
|
||||
engineConfiguration->firingOrder = FO_1_8_7_2_6_5_4_3;
|
||||
|
||||
engineConfiguration->enableSoftwareKnock = true;
|
||||
|
||||
|
|
|
@ -25,13 +25,13 @@ void setGy6139qmbDefaultEngineConfiguration() {
|
|||
setTargetRpmCurve(2000);
|
||||
engineConfiguration->analogInputDividerCoefficient = 1;
|
||||
engineConfiguration->globalTriggerAngleOffset = 45;
|
||||
engineConfiguration->specs.displacement = 0.072; // 72cc
|
||||
engineConfiguration->specs.cylindersCount = 1;
|
||||
engineConfiguration->displacement = 0.072; // 72cc
|
||||
engineConfiguration->cylindersCount = 1;
|
||||
setCrankOperationMode();
|
||||
// this is related to 'setDefaultBaseEngine' having 'skippedWheelOnCam = true' which is a weird fact by itself
|
||||
engineConfiguration->skippedWheelOnCam = false;
|
||||
|
||||
engineConfiguration->specs.firingOrder = FO_1;
|
||||
engineConfiguration->firingOrder = FO_1;
|
||||
|
||||
/**
|
||||
* We treat the trigger as 8-1 toothed wheel
|
||||
|
|
|
@ -90,11 +90,11 @@ void m73engine() {
|
|||
// 13641435991 injector
|
||||
engineConfiguration->injector.flow = 180; // cc/min, who knows if this number is real - no good source of info
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 12;
|
||||
engineConfiguration->specs.displacement = 5.4;
|
||||
engineConfiguration->cylindersCount = 12;
|
||||
engineConfiguration->displacement = 5.4;
|
||||
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_BMW);
|
||||
strcpy(engineConfiguration->engineCode, "M73");
|
||||
engineConfiguration->specs.firingOrder = FO_1_7_5_11_3_9_6_12_2_8_4_10;
|
||||
engineConfiguration->firingOrder = FO_1_7_5_11_3_9_6_12_2_8_4_10;
|
||||
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
|
||||
engineConfiguration->canNbcType = CAN_BUS_NBC_NONE;
|
||||
|
||||
|
|
|
@ -72,9 +72,9 @@ void setEngineBMW_M73_microRusEfi() {
|
|||
strcpy(engineConfiguration->vehicleName, "microRusEFIx2");
|
||||
|
||||
engineConfiguration->globalTriggerAngleOffset = 90;
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->specs.displacement = 5.4 / 2;
|
||||
engineConfiguration->specs.firingOrder = FO_1_5_3_6_2_4;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
engineConfiguration->displacement = 5.4 / 2;
|
||||
engineConfiguration->firingOrder = FO_1_5_3_6_2_4;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ void setCamaro4() {
|
|||
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
||||
engineConfiguration->specs.displacement = 5.7;
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
engineConfiguration->displacement = 5.7;
|
||||
engineConfiguration->cylindersCount = 8;
|
||||
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_GM);
|
||||
|
||||
engineConfiguration->specs.firingOrder = FO_1_8_7_2_6_5_4_3;
|
||||
engineConfiguration->firingOrder = FO_1_8_7_2_6_5_4_3;
|
||||
engineConfiguration->triggerInputPins[0] = Gpio::A5;
|
||||
engineConfiguration->triggerInputPins[1] = Gpio::C6;
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ void setCitroenBerlingoTU3JPConfiguration() {
|
|||
setCrankOperationMode();
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->globalTriggerAngleOffset = 114;
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.displacement = 1.360;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->displacement = 1.360;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
engineConfiguration->injectionMode = IM_BATCH;
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
|
|
|
@ -55,7 +55,7 @@ void setDodgeNeon1995EngineConfiguration() {
|
|||
// set ignition_mode 2
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
// set_firing_order 2
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
// set global_trigger_offset_angle 497
|
||||
engineConfiguration->globalTriggerAngleOffset = 497;
|
||||
|
@ -115,8 +115,8 @@ void setDodgeNeonNGCEngineConfiguration() {
|
|||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
engineConfiguration->specs.displacement = 1.996;
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->displacement = 1.996;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
|
||||
/**
|
||||
* 77C
|
||||
|
|
|
@ -20,9 +20,9 @@ void setDodgeRam1996() {
|
|||
engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003;
|
||||
|
||||
//Base engine setting
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
engineConfiguration->specs.firingOrder = FO_1_8_4_3_6_5_7_2;
|
||||
engineConfiguration->specs.displacement = 5.2;
|
||||
engineConfiguration->cylindersCount = 8;
|
||||
engineConfiguration->firingOrder = FO_1_8_4_3_6_5_7_2;
|
||||
engineConfiguration->displacement = 5.2;
|
||||
|
||||
// set global_trigger_offset_angle -50
|
||||
engineConfiguration->globalTriggerAngleOffset = -50;
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
* @brief Default values for persistent properties
|
||||
*/
|
||||
void setFordInline6() {
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
|
||||
setCamOperationMode();
|
||||
|
||||
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
||||
engineConfiguration->specs.firingOrder = FO_1_5_3_6_2_4;
|
||||
engineConfiguration->firingOrder = FO_1_5_3_6_2_4;
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
engineConfiguration->injectionMode = IM_BATCH;
|
||||
engineConfiguration->twoWireBatchInjection = true;
|
||||
|
|
|
@ -59,12 +59,12 @@ void setFordAspireEngineConfiguration() {
|
|||
|
||||
// engineConfiguration->ignitionPinMode = OM_INVERTED;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.displacement = 1.3;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->displacement = 1.3;
|
||||
// Denso 195500-2110
|
||||
engineConfiguration->injector.flow = 119.8;
|
||||
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->globalTriggerAngleOffset = 175;
|
||||
|
||||
setDefaultAspireMaps();
|
||||
|
|
|
@ -74,7 +74,7 @@ void setFordEscortGt() {
|
|||
setDensoTODO(config);
|
||||
|
||||
engineConfiguration->globalFuelCorrection = 0.75;
|
||||
engineConfiguration->specs.displacement = 1.839;
|
||||
engineConfiguration->displacement = 1.839;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
||||
static const uint16_t veRpmBins[] =
|
||||
|
|
|
@ -19,10 +19,10 @@ void setGmLs4() {
|
|||
engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
|
||||
engineConfiguration->injector.flow = 440;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
engineConfiguration->cylindersCount = 8;
|
||||
setLeftRightBanksNeedBetterName();
|
||||
engineConfiguration->specs.firingOrder = FO_1_8_7_2_6_5_4_3;
|
||||
engineConfiguration->specs.displacement = 6.2;
|
||||
engineConfiguration->firingOrder = FO_1_8_7_2_6_5_4_3;
|
||||
engineConfiguration->displacement = 6.2;
|
||||
|
||||
engineConfiguration->etbIdleThrottleRange = 15;
|
||||
|
||||
|
|
|
@ -36,10 +36,10 @@ void setHonda600() {
|
|||
// set global_trigger_offset_angle 540
|
||||
engineConfiguration->globalTriggerAngleOffset = 540;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cranking.rpm = 800;
|
||||
// engineConfiguration->ignitionMode = IM_WASTED_SPARK; //IM_INDIVIDUAL_COILS;
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
#endif // HW_PROTEUS
|
||||
|
||||
void setHondaK() {
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.displacement = 2.4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->displacement = 2.4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->engineSyncCam = SC_Exhaust_First;
|
||||
engineConfiguration->trigger.type = TT_HONDA_K_CRANK_12_1;
|
||||
int magic = 12; // note that offset and VVT are related
|
||||
|
|
|
@ -109,8 +109,8 @@ void common079721_2351() {
|
|||
|
||||
engineConfiguration->engineChartSize = 300;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->fuelPumpPin = Gpio::Unassigned; // fuel pump is not controlled by ECU on this engine
|
||||
|
||||
|
@ -142,7 +142,7 @@ void common079721_2351() {
|
|||
*/
|
||||
void setFrankensteinMiata1996() {
|
||||
commonMiataNa();
|
||||
engineConfiguration->specs.displacement = 1.839;
|
||||
engineConfiguration->displacement = 1.839;
|
||||
|
||||
#if IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT
|
||||
copyTable(config->ignitionTable, miataNA8_maf_advance_table);
|
||||
|
|
|
@ -49,7 +49,7 @@ static void commonNA8() {
|
|||
engineConfiguration->ignitionDwellForCrankingMs = 4;
|
||||
engineConfiguration->displayLogicLevelsInEngineSniffer = true;
|
||||
|
||||
engineConfiguration->specs.displacement = 1.839;
|
||||
engineConfiguration->displacement = 1.839;
|
||||
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_MAZDA);
|
||||
strcpy(engineConfiguration->engineCode, "NA8");
|
||||
|
||||
|
|
|
@ -31,14 +31,14 @@ void setHellenMercedes128_4_cyl() {
|
|||
// is this M104 or M112 or both?
|
||||
void setHellenMercedes128_6_cyl() {
|
||||
common();
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
// 1-4-2-5-3-6 M104
|
||||
engineConfiguration->specs.firingOrder = FO_1_4_3_6_2_5; // M112
|
||||
engineConfiguration->firingOrder = FO_1_4_3_6_2_5; // M112
|
||||
}
|
||||
|
||||
// M113
|
||||
void setHellenMercedes128_8_cyl() {
|
||||
common();
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
engineConfiguration->specs.firingOrder = FO_1_5_4_2_6_3_7_8;
|
||||
engineConfiguration->cylindersCount = 8;
|
||||
engineConfiguration->firingOrder = FO_1_5_4_2_6_3_7_8;
|
||||
}
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
void setHellen121nissanQR() {
|
||||
engineConfiguration->trigger.type = TT_NISSAN_QR25;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->specs.displacement = 2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->displacement = 2;
|
||||
strcpy(engineConfiguration->engineCode, "QR");
|
||||
|
||||
engineConfiguration->camInputs[1 * CAMS_PER_BANK] = Gpio::Unassigned;
|
||||
|
@ -35,9 +35,9 @@ static void setNissanVqEngineConfig() {
|
|||
setNissanMAF0031(config);
|
||||
engineConfiguration->trigger.type = TT_NISSAN_VQ35;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->specs.firingOrder = FO_1_2_3_4_5_6;
|
||||
engineConfiguration->specs.displacement = 4;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
engineConfiguration->firingOrder = FO_1_2_3_4_5_6;
|
||||
engineConfiguration->displacement = 4;
|
||||
strcpy(engineConfiguration->engineCode, "VQ");
|
||||
|
||||
engineConfiguration->vvtMode[0] = VVT_NISSAN_VQ;
|
||||
|
@ -81,7 +81,7 @@ void setHellen121nissanAltimaN16() {
|
|||
// https://en.wikipedia.org/wiki/Nissan_QG_engine
|
||||
// https://en.wikipedia.org/wiki/N-VCT
|
||||
setHellen121nissanQR();
|
||||
engineConfiguration->specs.displacement = 1.8;
|
||||
engineConfiguration->displacement = 1.8;
|
||||
strcpy(engineConfiguration->engineCode, "N16");
|
||||
|
||||
}
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
void setSachs() {
|
||||
|
||||
engineConfiguration->specs.displacement = 0.1; // 100cc
|
||||
engineConfiguration->specs.cylindersCount = 1;
|
||||
engineConfiguration->displacement = 0.1; // 100cc
|
||||
engineConfiguration->cylindersCount = 1;
|
||||
|
||||
setTwoStrokeOperationMode();
|
||||
engineConfiguration->specs.firingOrder = FO_1;
|
||||
engineConfiguration->firingOrder = FO_1;
|
||||
engineConfiguration->engineChartSize = 400;
|
||||
|
||||
setEgoSensor(ES_Innovate_MTX_L);
|
||||
|
|
|
@ -44,11 +44,11 @@ void setSubaruEJ18_MRE() {
|
|||
|
||||
// engineConfiguration->isDoubleSolenoidIdle = true;
|
||||
|
||||
engineConfiguration->specs.displacement = 1.8;
|
||||
engineConfiguration->displacement = 1.8;
|
||||
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_SUBARU);
|
||||
strcpy(engineConfiguration->engineCode, "EJ18");
|
||||
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_2_4;
|
||||
engineConfiguration->firingOrder = FO_1_3_2_4;
|
||||
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
|
||||
|
@ -71,9 +71,9 @@ void setSubaruEG33Defaults() {
|
|||
|
||||
engineConfiguration->trigger.type = TT_SUBARU_SVX;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
setLeftRightBanksNeedBetterName();
|
||||
engineConfiguration->specs.firingOrder = FO_1_6_3_2_5_4;
|
||||
engineConfiguration->firingOrder = FO_1_6_3_2_5_4;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
|
@ -84,7 +84,7 @@ void setSubaruEG33Defaults() {
|
|||
|
||||
engineConfiguration->fuelAlgorithm = LM_REAL_MAF;
|
||||
|
||||
engineConfiguration->specs.displacement = 3.30;
|
||||
engineConfiguration->displacement = 3.30;
|
||||
engineConfiguration->injector.flow = 250;
|
||||
|
||||
engineConfiguration->cranking.baseFuel = 5; // ???
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
static void common2jz() {
|
||||
setFrankensoConfiguration(); // default pinout
|
||||
|
||||
engineConfiguration->specs.displacement = 3.0;
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->specs.firingOrder = FO_1_5_3_6_2_4;
|
||||
engineConfiguration->displacement = 3.0;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
engineConfiguration->firingOrder = FO_1_5_3_6_2_4;
|
||||
// set ignition_mode 1
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ void setVwAba() {
|
|||
|
||||
|
||||
//Base engine setting
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.displacement = 2.0;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->displacement = 2.0;
|
||||
engineConfiguration->injector.flow = 320; // 30lb/h
|
||||
// set algorithm 3
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
@ -62,27 +62,27 @@ void setVwAba() {
|
|||
}
|
||||
|
||||
void setHellen121Vag_5_cyl() {
|
||||
engineConfiguration->specs.cylindersCount = 5;
|
||||
engineConfiguration->specs.displacement = 2.5;
|
||||
engineConfiguration->specs.firingOrder = FO_1_2_4_5_3;
|
||||
engineConfiguration->cylindersCount = 5;
|
||||
engineConfiguration->displacement = 2.5;
|
||||
engineConfiguration->firingOrder = FO_1_2_4_5_3;
|
||||
}
|
||||
|
||||
void setHellen121Vag_vr6_cyl() {
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->specs.firingOrder = FO_1_5_3_6_2_4;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
engineConfiguration->firingOrder = FO_1_5_3_6_2_4;
|
||||
}
|
||||
|
||||
void setHellen121Vag_v6_cyl() {
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->specs.displacement = 2.7;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
engineConfiguration->displacement = 2.7;
|
||||
|
||||
engineConfiguration->camInputs[1 * CAMS_PER_BANK] = Gpio::A7; // 87a
|
||||
|
||||
engineConfiguration->specs.firingOrder = FO_1_4_3_6_2_5;
|
||||
engineConfiguration->firingOrder = FO_1_4_3_6_2_5;
|
||||
}
|
||||
|
||||
void setHellen121Vag_8_cyl() {
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
engineConfiguration->specs.displacement = 4.2;
|
||||
engineConfiguration->specs.firingOrder = FO_1_5_4_8_6_3_7_2;
|
||||
engineConfiguration->cylindersCount = 8;
|
||||
engineConfiguration->displacement = 4.2;
|
||||
engineConfiguration->firingOrder = FO_1_5_4_8_6_3_7_2;
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ static void commonPassatB6() {
|
|||
engineConfiguration->idlePidRpmDeadZone = 500;
|
||||
engineConfiguration->idleMode = IM_AUTO;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->isPhaseSyncRequiredForIgnition = true;
|
||||
|
||||
engineConfiguration->disableEtbWhenEngineStopped = true;
|
||||
|
|
|
@ -176,7 +176,7 @@ static void printEngineSnifferPinMappings() {
|
|||
printOutPin(PROTOCOL_WA_CHANNEL_2, engineConfiguration->logicAnalyzerPins[1]);
|
||||
#endif /* EFI_LOGIC_ANALYZER */
|
||||
|
||||
int cylCount = minI(engineConfiguration->specs.cylindersCount, MAX_CYLINDER_COUNT);
|
||||
int cylCount = minI(engineConfiguration->cylindersCount, MAX_CYLINDER_COUNT);
|
||||
for (int i = 0; i < cylCount; i++) {
|
||||
printOutPin(enginePins.coils[i].getShortName(), engineConfiguration->ignitionPins[i]);
|
||||
printOutPin(enginePins.trailingCoils[i].getShortName(), engineConfiguration->trailingCoilPins[i]);
|
||||
|
|
|
@ -56,7 +56,7 @@ AirmassResult MafAirmass::getAirmassImpl(float massAirFlow, int rpm) const {
|
|||
|
||||
// Now we have to divide among cylinders - on a 4 stroke, half of the cylinders happen every revolution
|
||||
// This math is floating point to work properly on engines with odd cylinder count
|
||||
float halfCylCount = engineConfiguration->specs.cylindersCount / 2.0f;
|
||||
float halfCylCount = engineConfiguration->cylindersCount / 2.0f;
|
||||
|
||||
mass_t cylinderAirmass = airPerRevolution / halfCylCount;
|
||||
|
||||
|
|
|
@ -24,6 +24,6 @@ mass_t idealGasLaw(float volume, float pressure, float temperature) {
|
|||
}
|
||||
|
||||
/*static*/ mass_t SpeedDensityBase::getAirmassImpl(float ve, float manifoldPressure, float temperature) {
|
||||
mass_t cycleAir = ve * idealGasLaw(engineConfiguration->specs.displacement, manifoldPressure, temperature);
|
||||
return cycleAir / engineConfiguration->specs.cylindersCount;
|
||||
mass_t cycleAir = ve * idealGasLaw(engineConfiguration->displacement, manifoldPressure, temperature);
|
||||
return cycleAir / engineConfiguration->cylindersCount;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ static void setDefaultAlternatorParameters() {
|
|||
|
||||
/* Cylinder to bank mapping */
|
||||
void setLeftRightBanksNeedBetterName() {
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
engineConfiguration->cylinderBankSelect[i] = i % 2;
|
||||
}
|
||||
}
|
||||
|
@ -37,9 +37,9 @@ static void setDefaultHPFP() {
|
|||
|
||||
void setDefaultBaseEngine() {
|
||||
// Base Engine Settings
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.displacement = 2;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->displacement = 2;
|
||||
engineConfiguration->firingOrder = FO_1_3_4_2;
|
||||
|
||||
engineConfiguration->compressionRatio = 9;
|
||||
engineConfiguration->vssFilterReciprocal = VSS_FILTER_MIN;
|
||||
|
|
|
@ -184,7 +184,7 @@ void EngineState::periodicFastCallback() {
|
|||
}
|
||||
|
||||
// Now apply that to per-cylinder fueling and timing
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
uint8_t bankIndex = engineConfiguration->cylinderBankSelect[i];
|
||||
auto bankTrim =engine->stftCorrection[bankIndex];
|
||||
auto cylinderTrim = getCylinderFuelTrim(i, rpm, fuelLoad);
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
*/
|
||||
int sparkId = 0;
|
||||
/**
|
||||
* [0, specs.cylindersCount)
|
||||
* [0, cylindersCount)
|
||||
*/
|
||||
int cylinderIndex = 0;
|
||||
int8_t cylinderNumber = 0;
|
||||
|
|
|
@ -186,7 +186,7 @@ static float getBaseFuelMass(int rpm) {
|
|||
engine->engineState.fuelingLoad = airmass.EngineLoadPercent;
|
||||
engine->engineState.ignitionLoad = engine->fuelComputer.getLoadOverride(airmass.EngineLoadPercent, engineConfiguration->ignOverrideMode);
|
||||
|
||||
auto gramPerCycle = airmass.CylinderAirmass * engineConfiguration->specs.cylindersCount;
|
||||
auto gramPerCycle = airmass.CylinderAirmass * engineConfiguration->cylindersCount;
|
||||
auto gramPerMs = rpm == 0 ? 0 : gramPerCycle / getEngineCycleDuration(rpm);
|
||||
|
||||
// convert g/s -> kg/h
|
||||
|
@ -241,7 +241,7 @@ int getNumberOfInjections(injection_mode_e mode) {
|
|||
switch (mode) {
|
||||
case IM_SIMULTANEOUS:
|
||||
case IM_SINGLE_POINT:
|
||||
return engineConfiguration->specs.cylindersCount;
|
||||
return engineConfiguration->cylindersCount;
|
||||
case IM_BATCH:
|
||||
return 2;
|
||||
case IM_SEQUENTIAL:
|
||||
|
@ -257,7 +257,7 @@ float getInjectionModeDurationMultiplier() {
|
|||
|
||||
switch (mode) {
|
||||
case IM_SIMULTANEOUS: {
|
||||
auto cylCount = engineConfiguration->specs.cylindersCount;
|
||||
auto cylCount = engineConfiguration->cylindersCount;
|
||||
|
||||
if (cylCount == 0) {
|
||||
// we can end up here during configuration reset
|
||||
|
@ -428,8 +428,8 @@ float getCrankingFuel(float baseFuel) {
|
|||
* Should we bother caching 'getStandardAirCharge' result or can we afford to run the math every time we calculate fuel?
|
||||
*/
|
||||
float getStandardAirCharge() {
|
||||
float totalDisplacement = engineConfiguration->specs.displacement;
|
||||
float cylDisplacement = totalDisplacement / engineConfiguration->specs.cylindersCount;
|
||||
float totalDisplacement = engineConfiguration->displacement;
|
||||
float cylDisplacement = totalDisplacement / engineConfiguration->cylindersCount;
|
||||
|
||||
// Calculation of 100% VE air mass in g/cyl - 1 cylinder filling at 1.204/L
|
||||
// 101.325kpa, 20C
|
||||
|
|
|
@ -494,8 +494,8 @@ void commonInitEngineController() {
|
|||
|
||||
// Returns false if there's an obvious problem with the loaded configuration
|
||||
bool validateConfig() {
|
||||
if (engineConfiguration->specs.cylindersCount > MAX_CYLINDER_COUNT) {
|
||||
firmwareError(OBD_PCM_Processor_Fault, "Invalid cylinder count: %d", engineConfiguration->specs.cylindersCount);
|
||||
if (engineConfiguration->cylindersCount > MAX_CYLINDER_COUNT) {
|
||||
firmwareError(OBD_PCM_Processor_Fault, "Invalid cylinder count: %d", engineConfiguration->cylindersCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i) {
|
|||
injectorIndex = getCylinderId(i) - 1;
|
||||
} else if (mode == IM_BATCH) {
|
||||
// Loop over the first half of the firing order twice
|
||||
injectorIndex = i % (engineConfiguration->specs.cylindersCount / 2);
|
||||
injectorIndex = i % (engineConfiguration->cylindersCount / 2);
|
||||
} else {
|
||||
firmwareError(CUSTOM_OBD_UNEXPECTED_INJECTION_MODE, "Unexpected injection mode %d", mode);
|
||||
injectorIndex = 0;
|
||||
|
@ -168,7 +168,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i) {
|
|||
// Compute the position of this cylinder's twin in the firing order
|
||||
// Each injector gets fired as a primary (the same as sequential), but also
|
||||
// fires the injector 360 degrees later in the firing order.
|
||||
int secondOrder = (i + (engineConfiguration->specs.cylindersCount / 2)) % engineConfiguration->specs.cylindersCount;
|
||||
int secondOrder = (i + (engineConfiguration->cylindersCount / 2)) % engineConfiguration->cylindersCount;
|
||||
int secondIndex = getCylinderId(secondOrder) - 1;
|
||||
secondOutput = &enginePins.injectors[secondIndex];
|
||||
} else {
|
||||
|
@ -193,7 +193,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i) {
|
|||
}
|
||||
|
||||
void FuelSchedule::addFuelEvents() {
|
||||
for (size_t cylinderIndex = 0; cylinderIndex < engineConfiguration->specs.cylindersCount; cylinderIndex++) {
|
||||
for (size_t cylinderIndex = 0; cylinderIndex < engineConfiguration->cylindersCount; cylinderIndex++) {
|
||||
bool result = addFuelEventsForCylinder(cylinderIndex);
|
||||
|
||||
if (!result) {
|
||||
|
@ -212,7 +212,7 @@ void FuelSchedule::onTriggerTooth(int rpm, efitick_t nowNt, float currentPhase,
|
|||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
elements[i].onTriggerTooth(rpm, nowNt, currentPhase, nextPhase);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ angle_t HpfpLobe::findNextLobe() {
|
|||
// As a percent of the full pump stroke
|
||||
float HpfpQuantity::calcFuelPercent(int rpm) {
|
||||
float fuel_requested_cc_per_cycle =
|
||||
engine->engineState.injectionMass[0] * (1.f / fuelDensity) * engineConfiguration->specs.cylindersCount;
|
||||
engine->engineState.injectionMass[0] * (1.f / fuelDensity) * engineConfiguration->cylindersCount;
|
||||
float fuel_requested_cc_per_lobe = fuel_requested_cc_per_cycle / engineConfiguration->hpfpCamLobes;
|
||||
return 100.f *
|
||||
fuel_requested_cc_per_lobe / engineConfiguration->hpfpPumpVolume +
|
||||
|
|
|
@ -175,8 +175,8 @@ void refreshMapAveragingPreCalc() {
|
|||
angle_t offsetAngle = engine->triggerCentral.triggerFormDetails.eventAngles[engineConfiguration->mapAveragingSchedulingAtIndex];
|
||||
efiAssertVoid(CUSTOM_ERR_MAP_AVG_OFFSET, !cisnan(offsetAngle), "offsetAngle");
|
||||
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
angle_t cylinderOffset = getEngineCycle(getEngineRotationState()->getOperationMode()) * i / engineConfiguration->specs.cylindersCount;
|
||||
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
angle_t cylinderOffset = getEngineCycle(getEngineRotationState()->getOperationMode()) * i / engineConfiguration->cylindersCount;
|
||||
efiAssertVoid(CUSTOM_ERR_MAP_CYL_OFFSET, !cisnan(cylinderOffset), "cylinderOffset");
|
||||
// part of this formula related to specific cylinder offset is never changing - we can
|
||||
// move the loop into start-up calculation and not have this loop as part of periodic calculation
|
||||
|
@ -187,7 +187,7 @@ void refreshMapAveragingPreCalc() {
|
|||
}
|
||||
engine->engineState.mapAveragingDuration = interpolate2d(rpm, c->samplingWindowBins, c->samplingWindow);
|
||||
} else {
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
engine->engineState.mapAveragingStart[i] = NAN;
|
||||
}
|
||||
engine->engineState.mapAveragingDuration = NAN;
|
||||
|
@ -217,7 +217,7 @@ void mapAveragingTriggerCallback(
|
|||
}
|
||||
|
||||
// todo: this could be pre-calculated
|
||||
int samplingCount = engineConfiguration->measureMapOnlyInOneCylinder ? 1 : engineConfiguration->specs.cylindersCount;
|
||||
int samplingCount = engineConfiguration->measureMapOnlyInOneCylinder ? 1 : engineConfiguration->cylindersCount;
|
||||
|
||||
for (int i = 0; i < samplingCount; i++) {
|
||||
angle_t samplingStart = engine->engineState.mapAveragingStart[i];
|
||||
|
|
|
@ -21,7 +21,7 @@ static bool noFiringUntilVvtSync(vvt_mode_e vvtMode) {
|
|||
|
||||
// Odd cylinder count engines don't work properly with wasted spark, so wait for full sync (so that sequential works)
|
||||
// See https://github.com/rusefi/rusefi/issues/4195 for the issue to properly support this case
|
||||
if (engineConfiguration->specs.cylindersCount > 1 && engineConfiguration->specs.cylindersCount % 2 == 1) {
|
||||
if (engineConfiguration->cylindersCount > 1 && engineConfiguration->cylindersCount % 2 == 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ float IFuelComputer::getTChargeCoefficient(int rpm, float tps) {
|
|||
|
||||
constexpr floatms_t gramsPerMsToKgPerHour = (3600.0f * 1000.0f) / 1000.0f;
|
||||
// We're actually using an 'old' airMass calculated for the previous cycle, but it's ok, we're not having any self-excitaton issues
|
||||
floatms_t airMassForEngine = sdAirMassInOneCylinder * engineConfiguration->specs.cylindersCount;
|
||||
floatms_t airMassForEngine = sdAirMassInOneCylinder * engineConfiguration->cylindersCount;
|
||||
// airMass is in grams per 1 cycle for 1 cyl. Convert it to airFlow in kg/h for the engine.
|
||||
// And if the engine is stopped (0 rpm), then airFlow is also zero (avoiding NaN division)
|
||||
floatms_t airFlow = (rpm == 0) ? 0 : airMassForEngine * gramsPerMsToKgPerHour / getEngineCycleDuration(rpm);
|
||||
|
|
|
@ -270,7 +270,7 @@ void EnginePins::startAuxValves() {
|
|||
|
||||
void EnginePins::startIgnitionPins() {
|
||||
#if EFI_PROD_CODE
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
NamedOutputPin *trailingOutput = &enginePins.trailingCoils[i];
|
||||
if (isPinOrModeChanged(trailingCoilPins[i], ignitionPinMode)) {
|
||||
trailingOutput->initPin(trailingOutput->name, engineConfiguration->trailingCoilPins[i], &engineConfiguration->ignitionPinMode);
|
||||
|
@ -287,7 +287,7 @@ void EnginePins::startIgnitionPins() {
|
|||
void EnginePins::startInjectionPins() {
|
||||
#if EFI_PROD_CODE
|
||||
// todo: should we move this code closer to the injection logic?
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
NamedOutputPin *output = &enginePins.injectors[i];
|
||||
if (isPinOrModeChanged(injectionPins[i], injectionPinMode)) {
|
||||
output->initPin(output->name, engineConfiguration->injectionPins[i],
|
||||
|
|
|
@ -13,14 +13,14 @@ extern bool printFuelDebug;
|
|||
|
||||
void startSimultaneousInjection(void*) {
|
||||
efitick_t nowNt = getTimeNowNt();
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
enginePins.injectors[i].open(nowNt);
|
||||
}
|
||||
}
|
||||
|
||||
void endSimultaneousInjectionOnlyTogglePins() {
|
||||
efitick_t nowNt = getTimeNowNt();
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
|
||||
enginePins.injectors[i].close(nowNt);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -506,8 +506,7 @@ ThermistorConf iat;
|
|||
int hip9011PrescalerAndSDO;value '6' for 8MHz hw osc\nread hip9011 datasheet for details\ntodo split into two bit fields;"integer", 1, 0, 0, 32, 0
|
||||
float knockBandCustom;We calculate knock band based of cylinderBore\n Use this to override - kHz knock band override;"kHz", 1, 0, 0, 20, 2
|
||||
|
||||
struct_no_prefix specs_s
|
||||
float displacement;Engine volume/capacity, in litres\nsee also cylindersCount;"L", 1, 0, 0, 1000, 2
|
||||
uint16_t autoscale displacement;Engine displacement in litres;"L", 0.001, 0, 0, 65, 3
|
||||
|
||||
uint32_t cylindersCount;Number of cylinder the engine has.;"", 1, 0, 1, @@MAX_CYLINDER_COUNT@@, 0
|
||||
|
||||
|
@ -519,10 +518,9 @@ uint32_t cylindersCount;Number of cylinder the engine has.;"", 1, 0, 1, @@MAX_CY
|
|||
|
||||
custom firing_order_e 1 bits, U08, @OFFSET@, [0:5], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1-2-3-4-5-6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "1-12-5-8-3-10-6-7-2-11-4-9", "1-2-7-8-4-5-6-3", "1-3-7-2-6-5-4-8", "1-2-3-4-5-6-7-8-9", "INVALID", "1-2-3-4-5-6-7-8-9-10-11-12", "1-3-2", "1-2-3-4-5-6-7-8", "1-5-4-8-6-3-7-2", "1-4-3-6-2-5", "1-8-7-3-6-5-4-2", "1-6-2-4-3-5", "1-6-5-4-3-2", "1-4-5-2-3-6", "fo32", "fo33", "fo34", "fo35", "fo36", "fo37"
|
||||
firing_order_e firingOrder;
|
||||
end_struct
|
||||
|
||||
specs_s specs
|
||||
float cylinderBore;Cylinder diameter in mm.;"mm", 1, 0, 0, 20000, 2
|
||||
|
||||
float cylinderBore;Cylinder diameter in mm.;"mm", 1, 0, 0, 20000, 2
|
||||
|
||||
#define engine_load_mode_e_enum "Speed Density", "MAF Air Charge", "Alpha-N", "Lua"
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ void setupSimpleTestEngineWithMaf(EngineTestHelper *eth, injection_mode_e inject
|
|||
Engine *engine = ð->engine;
|
||||
|
||||
engineConfiguration->isIgnitionEnabled = false; // let's focus on injection
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
// a bit of flexibility - the mode may be changed by some tests
|
||||
engineConfiguration->injectionMode = injectionMode;
|
||||
// set cranking mode (it's used by getCurrentInjectionMode())
|
||||
|
|
|
@ -13,25 +13,25 @@ TEST(FuelMath, getStandardAirCharge) {
|
|||
EngineTestHelper eth(TEST_ENGINE);
|
||||
|
||||
// Miata 1839cc 4cyl
|
||||
engineConfiguration->specs.displacement = 1.839f;
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->displacement = 1.839f;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
|
||||
EXPECT_FLOAT_EQ(0.5535934f, getStandardAirCharge());
|
||||
|
||||
// LS 5.3 liter v8
|
||||
engineConfiguration->specs.displacement = 5.327f;
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
engineConfiguration->displacement = 5.327f;
|
||||
engineConfiguration->cylindersCount = 8;
|
||||
|
||||
EXPECT_FLOAT_EQ(0.80179232f, getStandardAirCharge());
|
||||
|
||||
// Chainsaw - single cylinder 32cc
|
||||
engineConfiguration->specs.displacement = 0.032f;
|
||||
engineConfiguration->specs.cylindersCount = 1;
|
||||
engineConfiguration->displacement = 0.032f;
|
||||
engineConfiguration->cylindersCount = 1;
|
||||
EXPECT_FLOAT_EQ(0.038531788f, getStandardAirCharge());
|
||||
|
||||
// Leopard 1 47.666 liter v12
|
||||
engineConfiguration->specs.displacement = 47.666f;
|
||||
engineConfiguration->specs.cylindersCount = 12;
|
||||
engineConfiguration->displacement = 47.666f;
|
||||
engineConfiguration->cylindersCount = 12;
|
||||
|
||||
EXPECT_FLOAT_EQ(4.782959f, getStandardAirCharge());
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ TEST(FuelMath, getStandardAirCharge) {
|
|||
TEST(AirmassModes, AlphaNNormal) {
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
// 4 cylinder 4 liter = easy math
|
||||
engineConfiguration->specs.displacement = 4.0f;
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->displacement = 4.0f;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
|
||||
StrictMock<MockVp3d> veTable;
|
||||
|
||||
|
|
|
@ -56,8 +56,8 @@ TEST(ignition, trailingSpark) {
|
|||
.WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f}));
|
||||
|
||||
setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð);
|
||||
engineConfiguration->specs.cylindersCount = 1;
|
||||
engineConfiguration->specs.firingOrder = FO_1;
|
||||
engineConfiguration->cylindersCount = 1;
|
||||
engineConfiguration->firingOrder = FO_1;
|
||||
engineConfiguration->isInjectionEnabled = false;
|
||||
engineConfiguration->isIgnitionEnabled = true;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ TEST(HPFP, Lobe) {
|
|||
TEST(HPFP, InjectionReplacementFuel) {
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->hpfpCamLobes = 4;
|
||||
engine->engineState.injectionMass[0] = 0.05 /* cc/cyl */ * fuelDensity;
|
||||
engineConfiguration->hpfpPumpVolume = 0.2; // cc/lobe
|
||||
|
@ -71,11 +71,11 @@ TEST(HPFP, InjectionReplacementFuel) {
|
|||
EXPECT_FLOAT_EQ(math.calcFuelPercent(1000), 50 * 1.333333333f);
|
||||
|
||||
// More cylinders!
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
EXPECT_FLOAT_EQ(math.calcFuelPercent(1000), 50 * 2.); // Ooops we maxed out
|
||||
|
||||
// Compensation testing
|
||||
engineConfiguration->specs.cylindersCount =
|
||||
engineConfiguration->cylindersCount =
|
||||
engineConfiguration->hpfpCamLobes; // Make math easier
|
||||
for (int i = 0; i < HPFP_COMPENSATION_SIZE; i++) {
|
||||
// one bin every 1000 RPM
|
||||
|
@ -106,7 +106,7 @@ TEST(HPFP, InjectionReplacementFuel) {
|
|||
TEST(HPFP, PI) {
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->hpfpCamLobes = 4;
|
||||
engine->engineState.injectionMass[0] = 0.05 /* cc/cyl */ * fuelDensity;
|
||||
engineConfiguration->hpfpPumpVolume = 0.2; // cc/lobe
|
||||
|
@ -163,7 +163,7 @@ TEST(HPFP, PI) {
|
|||
TEST(HPFP, Angle) {
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->hpfpCamLobes = 4;
|
||||
engine->engineState.injectionMass[0] = 0.05 /* cc/cyl */ * fuelDensity;
|
||||
engineConfiguration->hpfpPumpVolume = 0.2; // cc/lobe
|
||||
|
@ -209,7 +209,7 @@ TEST(HPFP, Angle) {
|
|||
TEST(HPFP, Schedule) {
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->hpfpCamLobes = 4;
|
||||
engineConfiguration->hpfpPumpVolume = 0.2; // cc/lobe
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ TEST(HPFP, IntegratedSchedule) {
|
|||
engineConfiguration->hpfpValvePin = Gpio::A2; // arbitrary
|
||||
});
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->hpfpCamLobes = 3;
|
||||
engineConfiguration->hpfpPumpVolume = 0.2; // cc/lobe
|
||||
|
||||
|
|
|
@ -960,7 +960,7 @@ TEST(big, testSparkReverseOrderBug319) {
|
|||
engine->tdcMarkEnabled = false;
|
||||
|
||||
engineConfiguration->isInjectionEnabled = false;
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||
|
||||
setConstantDwell(45);
|
||||
|
|
Loading…
Reference in New Issue