better macro name
This commit is contained in:
parent
0312166f13
commit
f8e592f454
|
@ -64,21 +64,21 @@ static const fuel_table_t default_139qmb_fuel_table = {
|
|||
|
||||
};
|
||||
|
||||
static void setDefault139qmbMaps(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setDefault139qmbMaps(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
|
||||
setFuelRpmBin(1000, 11000 PASS_ENGINE_PARAMETER);
|
||||
setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
|
||||
setTimingRpmBin(1000, 11000 PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelRpmBin(1000, 11000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingRpmBin(1000, 11000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
copyFuelTable(default_139qmb_fuel_table, config->fuelTable);
|
||||
//copyTimingTable(default_139qmb_timing_table, config->ignitionTable);
|
||||
}
|
||||
|
||||
void setGy6139qmbDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setDefault139qmbMaps(PASS_ENGINE_PARAMETER_F);
|
||||
void setGy6139qmbDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setDefault139qmbMaps(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
// engineConfiguration->map.sensor.type = MT_3V_SENSOR;
|
||||
setEgoSensor(ES_NarrowBand PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_NarrowBand PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
engineConfiguration->rpmHardLimit = 9000;
|
||||
engineConfiguration->cranking.rpm = 1100;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
void setBmwE34(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setBmwE34(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
// chartsize 450
|
||||
engineConfiguration->engineChartSize = 450;
|
||||
|
||||
|
@ -52,14 +52,14 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
|
||||
// Injection settings
|
||||
setInjectorLag(1.15 PASS_ENGINE_PARAMETER);
|
||||
setInjectorLag(1.15 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
engineConfiguration->injector.flow = 750;
|
||||
|
||||
// General settings
|
||||
boardConfiguration->tunerStudioSerialSpeed = 57600;
|
||||
engineConfiguration->rpmHardLimit = 7000;
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// for best performance at high RPM, we need to turn off 'Engine Sniffer' and 'Sensor Sniffer'
|
||||
boardConfiguration->sensorChartMode = SC_OFF;
|
||||
|
@ -69,7 +69,7 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->isInjectionEnabled = true;
|
||||
engineConfiguration->isIgnitionEnabled = true;
|
||||
|
||||
setConstantDwell(3 PASS_ENGINE_PARAMETER); // a bit shorter dwell
|
||||
setConstantDwell(3 PASS_ENGINE_PARAMETER_SUFFIX); // a bit shorter dwell
|
||||
engineConfiguration->ignMathCalculateAtIndex = 14;
|
||||
|
||||
engineConfiguration->mapAveragingSchedulingAtIndex = 6;
|
||||
|
@ -93,7 +93,7 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->triggerInputPins[0] = GPIOA_5;
|
||||
boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;
|
||||
|
||||
setWholeTimingTable(25 PASS_ENGINE_PARAMETER);
|
||||
setWholeTimingTable(25 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void set1973c20(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void set1973c20(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
||||
engineConfiguration->specs.displacement = 5.7;
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
|
@ -38,7 +38,7 @@ void set1973c20(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->trigger.customSkippedToothCount = 0;
|
||||
|
||||
engineConfiguration->rpmHardLimit = 5000;
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
void setCamaro4(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setCamaro4(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
engineConfiguration->specs.displacement = 5.7;
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
|
|
|
@ -69,7 +69,7 @@ static const ignition_table_t tps_advance_table = {
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setCitroenBerlingoTU3JPConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setCitroenBerlingoTU3JPConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->engineType = CITROEN_TU3JP;
|
||||
|
||||
/**
|
||||
|
@ -98,10 +98,10 @@ void setCitroenBerlingoTU3JPConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* Algorithm Alpha-N setting
|
||||
*/
|
||||
setAlgorithm(LM_ALPHA_N PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
|
||||
setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_ALPHA_N PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
/**
|
||||
* Outputs
|
||||
|
|
|
@ -41,7 +41,7 @@ void disableLCD(board_configuration_s *boardConfiguration) {
|
|||
|
||||
// todo: should this be renamed to 'setFrankensoConfiguration'?
|
||||
// todo: should this be part of more default configurations?
|
||||
void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->trigger.type = TT_ONE_PLUS_ONE;
|
||||
|
||||
setFrankenso_01_LCD(boardConfiguration);
|
||||
|
@ -103,7 +103,7 @@ void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->injectionPins[2] = GPIOB_8; // #3
|
||||
boardConfiguration->injectionPins[3] = GPIOB_7; // #4
|
||||
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
#if EFI_PWM_TESTER
|
||||
boardConfiguration->injectionPins[4] = GPIOC_8; // #5
|
||||
|
@ -146,8 +146,8 @@ void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void setFrankensoBoardTestConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setFrankensoBoardTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 12;
|
||||
engineConfiguration->specs.firingOrder = FO_1_7_5_11_3_9_6_12_2_8_4_10;
|
||||
|
|
|
@ -145,7 +145,7 @@ static const fuel_table_t veDodgeNeon2003Table = {
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setDodgeNeon1995EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setDodgeNeon1995EngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->trigger.type = TT_DODGE_NEON_1995;
|
||||
|
||||
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
|
||||
|
@ -177,8 +177,8 @@ void setDodgeNeon1995EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
*/
|
||||
|
||||
// set_whole_fuel_map 9
|
||||
setWholeFuelMap(9 PASS_ENGINE_PARAMETER);
|
||||
setWholeTimingTable(12 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(9 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setWholeTimingTable(12 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// set cranking_injection_mode 0
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
|
@ -252,7 +252,7 @@ void setDodgeNeon1995EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->sensorChartFrequency = 7;
|
||||
}
|
||||
|
||||
void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->trigger.type = TT_DODGE_NEON_2003_CAM;
|
||||
setFrankenso_01_LCD(boardConfiguration);
|
||||
setFrankenso0_1_joystick(engineConfiguration);
|
||||
|
@ -297,9 +297,9 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
*
|
||||
* set_whole_fuel_map 12
|
||||
*/
|
||||
//setWholeFuelMap(12 PASS_ENGINE_PARAMETER);
|
||||
//setWholeFuelMap(12 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// copyFuelTable(alphaNfuel, config->fuelTable);
|
||||
//setWholeTimingTable(12 PASS_ENGINE_PARAMETER);
|
||||
//setWholeTimingTable(12 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
copyTimingTable(fromODB, config->ignitionTable);
|
||||
|
||||
copy2DTable<FSIO_TABLE_8, FSIO_TABLE_8, float>(vBattTarget, config->fsioTable1);
|
||||
|
@ -321,12 +321,12 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
//engineConfiguration->fuelAlgorithm = LM_ALPHA_N; // I want to start with a simple Alpha-N
|
||||
|
||||
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTableBin2(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 120, 1);
|
||||
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
setFuelTablesLoadBin(20, 120 PASS_ENGINE_PARAMETER);
|
||||
setFuelTablesLoadBin(20, 120 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED;
|
||||
|
||||
|
@ -468,7 +468,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// * set_fsio_setting 1 0.55
|
||||
// */
|
||||
// boardConfiguration->fsio_setting[0] = 0.55;
|
||||
// setFsioExt(0, GPIOE_5, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER);
|
||||
// setFsioExt(0, GPIOE_5, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#endif
|
||||
|
||||
boardConfiguration->vehicleSpeedSensorInputPin = GPIOA_8;
|
||||
|
@ -480,7 +480,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
// boardConfiguration->tunerStudioSerialSpeed = 9600;
|
||||
boardConfiguration->tunerStudioSerialSpeed = 19200;
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
//temp boardConfiguration->alternatorControlPin = GPIOD_5;
|
||||
engineConfiguration->targetVBatt = 14.0;
|
||||
|
@ -518,8 +518,8 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// end of setDodgeNeonNGCEngineConfiguration
|
||||
}
|
||||
|
||||
void setDodgeNeonNGCEngineConfigurationCrankBased(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setDodgeNeonNGCEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setDodgeNeonNGCEngineConfigurationCrankBased(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setDodgeNeonNGCEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
#endif /* EFI_SUPPORT_DODGE_NEON */
|
||||
|
|
|
@ -16,20 +16,20 @@
|
|||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
void setDodgeRam1996(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setDodgeRam1996(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
||||
engineConfiguration->trigger.type = TT_DODGE_RAM;
|
||||
engineConfiguration->injector.flow = 243.6; // 23.2lb/h
|
||||
engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003;
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// set cranking_charge_angle 30
|
||||
engineConfiguration->crankingChargeAngle = 30;
|
||||
|
||||
// set_whole_fuel_map 6
|
||||
setWholeFuelMap(6 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(6 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
//Base engine setting
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
|
@ -69,7 +69,7 @@ void setDodgeRam1996(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// set_global_fuel_correction 1
|
||||
|
||||
// set_whole_timing_map 10
|
||||
setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
|
||||
setWholeTimingTable(10 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
boardConfiguration->alternatorControlPin = GPIOD_7;
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
void setDodgeStratus(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setDodgeStratus(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->trigger.type = TT_DODGE_STRATUS;
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->specs.firingOrder = FO_1_2_3_4_5_6;
|
||||
|
||||
engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003;
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||
|
||||
boardConfiguration->ignitionPins[0] = GPIOC_9;
|
||||
|
|
|
@ -25,7 +25,7 @@ EXTERN_ENGINE;
|
|||
/**
|
||||
* @brief Default values for persistent properties
|
||||
*/
|
||||
void setFordInline6(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setFordInline6(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
||||
|
@ -40,7 +40,7 @@ void setFordInline6(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* 0.5ms dweel time just to be sure it would fit within camshaft revolution, dwell is not controlled by us anyway
|
||||
*/
|
||||
setConstantDwell(0.5 PASS_ENGINE_PARAMETER);
|
||||
setConstantDwell(0.5 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
/**
|
||||
* We treat the trigger as 6/0 toothed wheel
|
||||
|
|
|
@ -67,18 +67,18 @@ static const ignition_table_t default_aspire_timing_table = {
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
static void setDefaultAspireMaps(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setDefaultAspireMaps(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
|
||||
setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
|
||||
setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
copyFuelTable(default_aspire_fuel_table, config->fuelTable);
|
||||
copyTimingTable(default_aspire_timing_table, config->ignitionTable);
|
||||
}
|
||||
|
||||
void setFordAspireEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setFordAspireEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->tpsMin = 100;
|
||||
engineConfiguration->tpsMax = 750;
|
||||
|
||||
|
@ -106,7 +106,7 @@ void setFordAspireEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->ignitionOffset = 87;
|
||||
engineConfiguration->extraInjectionOffset = 54 + 360;
|
||||
|
||||
setDefaultAspireMaps(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultAspireMaps(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
// set_cranking_rpm 550
|
||||
engineConfiguration->cranking.rpm = 550;
|
||||
// set cranking_charge_angle 70
|
||||
|
|
|
@ -66,7 +66,7 @@ EXTERN_ENGINE;
|
|||
* pin 1I/W9 - extra +5v
|
||||
* set engine_type 14
|
||||
*/
|
||||
void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setFordEscortGt(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4;
|
||||
|
||||
common079721_2351(engineConfiguration, boardConfiguration);
|
||||
|
@ -79,11 +79,11 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->globalFuelCorrection = 0.75;
|
||||
engineConfiguration->specs.displacement = 1.839;
|
||||
// engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF;
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// engineConfiguration->fuelAlgorithm = LM_REAL_MAF;
|
||||
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
config->veRpmBins[0] = 800;
|
||||
config->veRpmBins[1] = 1200;
|
||||
|
@ -122,13 +122,13 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->map.sensor.type = MT_DENSO183;
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
|
||||
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_2; // Frankenso analog #5
|
||||
|
||||
// set_idle_position 10
|
||||
boardConfiguration->manIdlePosition = 10;
|
||||
|
||||
setWholeIatCorrTimingTable(0 PASS_ENGINE_PARAMETER);
|
||||
setWholeIatCorrTimingTable(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
// set global_trigger_offset_angle -37
|
||||
|
@ -146,9 +146,9 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->cranking.baseFuel = 9;
|
||||
|
||||
setTableBin2(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 105, 5);
|
||||
setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
|
||||
setWholeTimingTable(10 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// set_whole_fuel_map 5
|
||||
setWholeFuelMap(5 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(5 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setAfrMap(config->afrTable, 13.5);
|
||||
|
||||
setSingleCoilDwell(engineConfiguration);
|
||||
|
@ -231,7 +231,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
|||
*/
|
||||
boardConfiguration->fsio_setting[0] = 5000;
|
||||
// set_fsio_expression 1 "rpm > fsio_setting(1)"
|
||||
setFsioExt(0, GPIOE_3, "rpm 1 fsio_setting >", 150 PASS_ENGINE_PARAMETER);
|
||||
setFsioExt(0, GPIOE_3, "rpm 1 fsio_setting >", 150 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
// warning light
|
||||
|
@ -249,8 +249,8 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->fsio_setting[2] = 90; // CLT threshold
|
||||
boardConfiguration->fsio_setting[3] = 13.5; // voltage threshold
|
||||
|
||||
// setFsio(1, GPIOC_13, "rpm 2 fsio_setting > coolant 3 fsio_setting > | vbatt 4 fsio_setting < |" PASS_ENGINE_PARAMETER);
|
||||
setFsio(1, GPIOD_7, "rpm 2 fsio_setting >" PASS_ENGINE_PARAMETER);
|
||||
// setFsio(1, GPIOC_13, "rpm 2 fsio_setting > coolant 3 fsio_setting > | vbatt 4 fsio_setting < |" PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFsio(1, GPIOD_7, "rpm 2 fsio_setting >" PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
config->ignitionRpmBins[0] = 800;
|
||||
|
|
|
@ -47,19 +47,19 @@ static const ignition_table_t default_custom_timing_table = {
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
static void setDefaultCustomMaps(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setDefaultCustomMaps(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
||||
setFuelLoadBin(0,100 PASS_ENGINE_PARAMETER);
|
||||
setFuelRpmBin(0, 7000 PASS_ENGINE_PARAMETER);
|
||||
setTimingLoadBin(0,100 PASS_ENGINE_PARAMETER);
|
||||
setTimingRpmBin(0,7000 PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(0,100 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelRpmBin(0, 7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingLoadBin(0,100 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingRpmBin(0,7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
copyFuelTable(default_custom_fuel_table, config->fuelTable);
|
||||
copyFuelTable(default_custom_fuel_table, config->veTable);
|
||||
copyTimingTable(default_custom_timing_table, config->ignitionTable);
|
||||
}
|
||||
|
||||
void setHonda600(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setHonda600(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->trigger.type = TT_HONDA_CBR_600_CUSTOM;
|
||||
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
|
||||
|
||||
|
@ -144,8 +144,8 @@ void setHonda600(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->injectionPins[2] = GPIOB_7; // #3
|
||||
boardConfiguration->injectionPins[3] = GPIOB_8; // #4
|
||||
|
||||
setDefaultCustomMaps(PASS_ENGINE_PARAMETER_F);
|
||||
setAlgorithm(LM_ALPHA_N PASS_ENGINE_PARAMETER);
|
||||
setDefaultCustomMaps(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
setAlgorithm(LM_ALPHA_N PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
boardConfiguration->injectionPins[4] = GPIO_UNASSIGNED;
|
||||
boardConfiguration->injectionPins[5] = GPIO_UNASSIGNED;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
static void setHondaAccordConfigurationCommon(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setHondaAccordConfigurationCommon(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->map.sensor.type = MT_DENSO183;
|
||||
boardConfiguration->isFastAdcEnabled = true;
|
||||
|
||||
|
@ -57,10 +57,10 @@ static void setHondaAccordConfigurationCommon(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// Keihin 06164-P0A-A00
|
||||
engineConfiguration->injector.flow = 248;
|
||||
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
buildTimingMap(35 PASS_ENGINE_PARAMETER);
|
||||
buildTimingMap(35 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
/**
|
||||
* 18K Ohm @ -20C
|
||||
|
@ -177,43 +177,43 @@ static void setHondaAccordConfigurationCommon(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
|
||||
/*
|
||||
void setHondaAccordConfigurationTwoWires(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setHondaAccordConfigurationTwoWires(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->engineType = HONDA_ACCORD_CD_TWO_WIRES;
|
||||
engineConfiguration->trigger.type = TT_HONDA_ACCORD_CD_TWO_WIRES;
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
*/
|
||||
|
||||
void setHondaAccordConfigurationThreeWires(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setHondaAccordConfigurationThreeWires(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->engineType = HONDA_ACCORD_CD;
|
||||
engineConfiguration->trigger.type = TT_HONDA_4_24_1;
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
void setHondaAccordConfigurationDip(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setHondaAccordConfigurationDip(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->engineType = HONDA_ACCORD_CD_DIP;
|
||||
engineConfiguration->trigger.type = TT_HONDA_1_4_24;
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
void setHondaAccordConfiguration1_24(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setHondaAccordConfiguration1_24(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->engineType = HONDA_ACCORD_CD_DIP;
|
||||
engineConfiguration->trigger.type = TT_HONDA_1_24;
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
void setHondaAccordConfiguration1_24_shifted(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setHondaAccordConfiguration1_24_shifted(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->engineType = HONDA_ACCORD_1_24_SHIFTED;
|
||||
engineConfiguration->trigger.type = TT_HONDA_ACCORD_1_24_SHIFTED;
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// set global_trigger_offset_angle 0
|
||||
engineConfiguration->globalTriggerAngleOffset = 0;
|
||||
|
||||
}
|
||||
|
||||
void setHondaCivic4_0_both(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setHondaAccordConfiguration1_24_shifted(PASS_ENGINE_PARAMETER_F);
|
||||
void setHondaCivic4_0_both(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setHondaAccordConfiguration1_24_shifted(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||
engineConfiguration->trigger.customTotalToothCount = 4;
|
||||
|
@ -222,8 +222,8 @@ void setHondaCivic4_0_both(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
}
|
||||
|
||||
void setHondaCivic4_0_rise(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setHondaAccordConfiguration1_24_shifted(PASS_ENGINE_PARAMETER_F);
|
||||
void setHondaCivic4_0_rise(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setHondaAccordConfiguration1_24_shifted(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->trigger.customTotalToothCount = 4;
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setLadaKalina(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setLadaKalina(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
disableLCD(boardConfiguration);
|
||||
|
||||
boardConfiguration->HD44780_rs = GPIO_UNASSIGNED;
|
||||
|
@ -56,6 +56,6 @@ void setLadaKalina(DECLARE_ENGINE_PARAMETER_F) {
|
|||
*/
|
||||
engineConfiguration->bc.fsio_setting[0] = 500;
|
||||
// set_rpn_expression 1 "rpm 0 fsio_setting <"
|
||||
setFsioExt(0, GPIOE_3, "rpm 1 fsio_setting <", 0 PASS_ENGINE_PARAMETER);
|
||||
setFsioExt(0, GPIOE_3, "rpm 1 fsio_setting <", 0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
}
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
// engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
|
@ -62,14 +62,14 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->tpsMin = 80;
|
||||
engineConfiguration->tpsMax = 764;
|
||||
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// set_whole_fuel_map 9
|
||||
setWholeFuelMap(9 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(9 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// set_whole_timing_map 10
|
||||
setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
|
||||
setWholeTimingTable(10 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// http://s1.micp.ru/tOb0U.png
|
||||
setThermistorConfiguration(&engineConfiguration->clt, -15, 5900, 23, 1750, 97, 165);
|
||||
|
@ -95,12 +95,12 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
|
||||
// todo engineConfiguration->afr.hwChannel = EFI_ADC_3;
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
//#if EFI_FSIO || defined(__DOXYGEN__)
|
||||
// // backup main relay pin
|
||||
// setFsio(0, GPIOE_6, "1" PASS_ENGINE_PARAMETER);
|
||||
// setFsio(0, GPIOE_6, "1" PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
//#endif
|
||||
|
||||
engineConfiguration->externalKnockSenseAdc = EFI_ADC_4;
|
||||
|
|
|
@ -127,7 +127,7 @@ static void setDefaultCrankingFuel(engine_configuration_s *engineConfiguration)
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
static void commonMiataNa(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void commonMiataNa(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA;
|
||||
engineConfiguration->engineChartSize = 100;
|
||||
|
||||
|
@ -135,8 +135,8 @@ static void commonMiataNa(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP
|
||||
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
boardConfiguration->idle.solenoidFrequency = 160;
|
||||
|
||||
|
@ -201,10 +201,10 @@ void common079721_2351(engine_configuration_s *engineConfiguration, board_config
|
|||
/**
|
||||
* Frankenstein board
|
||||
*/
|
||||
void setMiata1990(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setMiata1990(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
common079721_2351(engineConfiguration, boardConfiguration);
|
||||
|
||||
commonMiataNa(PASS_ENGINE_PARAMETER_F);
|
||||
commonMiataNa(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// Frankenstein: low side - out #1: PC14
|
||||
// Frankenstein: low side - out #2: PC15
|
||||
|
@ -231,8 +231,8 @@ void setMiata1990(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
|
||||
|
||||
static void setMiata1994_common(DECLARE_ENGINE_PARAMETER_F) {
|
||||
commonMiataNa(PASS_ENGINE_PARAMETER_F);
|
||||
static void setMiata1994_common(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
commonMiataNa(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
engineConfiguration->specs.displacement = 1.839;
|
||||
|
||||
// set cranking_timing_angle 0
|
||||
|
@ -305,8 +305,8 @@ static void setMiata1994_common(DECLARE_ENGINE_PARAMETER_F) {
|
|||
* Frankenso board
|
||||
* set engine_type 20
|
||||
*/
|
||||
void setMiata1994_d(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setMiata1994_common(PASS_ENGINE_PARAMETER_F);
|
||||
void setMiata1994_d(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setMiata1994_common(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
engineConfiguration->vbattDividerCoeff = ((float) (8.2 + 33)) / 8.2 * 2;
|
||||
/**
|
||||
* This board was avoiding PE0 & PE1 mosfets altogether
|
||||
|
@ -320,8 +320,8 @@ void setMiata1994_d(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->idle.solenoidPin = GPIO_UNASSIGNED;
|
||||
}
|
||||
|
||||
void setMiata1994_s(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setMiata1994_common(PASS_ENGINE_PARAMETER_F);
|
||||
void setMiata1994_s(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setMiata1994_common(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
engineConfiguration->vbattDividerCoeff = ((float) (10.0 + 33)) / 10 * 2;
|
||||
|
||||
boardConfiguration->triggerSimulatorPins[2] = GPIO_UNASSIGNED;
|
||||
|
@ -329,7 +329,7 @@ void setMiata1994_s(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->acSwitchAdc = EFI_ADC_1; // PA1, W50 on Frankenso
|
||||
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_3;
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
/**
|
||||
* This board has PE0<>PD5 & PE1<>PD3 rewired in order to avoid Discovery issue
|
||||
|
@ -364,8 +364,8 @@ void setMiata1994_s(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* Tom tomiata, Frankenstein board
|
||||
*/
|
||||
void setMiata1996(DECLARE_ENGINE_PARAMETER_F) {
|
||||
commonMiataNa(PASS_ENGINE_PARAMETER_F);
|
||||
void setMiata1996(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
commonMiataNa(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
engineConfiguration->specs.displacement = 1.839;
|
||||
|
||||
copyFuelTable(miata_maf_fuel_table, config->fuelTable);
|
||||
|
|
|
@ -87,8 +87,8 @@ static const fuel_table_t mafBased16FuelTable = {
|
|||
{/* 15 4.400 *//* 0 800.0*/7.000, /* 1 1213.33*/7.000, /* 2 1626.6599*/7.000, /* 3 2040.0*/7.000, /* 4 2453.3298*/7.000, /* 5 2866.66*/7.000, /* 6 3280.0*/7.000, /* 7 3693.3298*/7.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, },
|
||||
};
|
||||
|
||||
void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// Frankenso analog #6 pin 3R, W56 (5th lower row pin from the end) top <> W45 bottom jumper, not OEM
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_7;
|
||||
|
@ -116,7 +116,7 @@ void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// Frankenso analog #7 pin 3J, W48 top <>W48 bottom jumper, not OEM
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_3; // PA3
|
||||
|
||||
setWholeFuelMap(6 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(6 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
/**
|
||||
* http://miataturbo.wikidot.com/fuel-injectors
|
||||
|
@ -190,7 +190,7 @@ void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// set_fsio_expression 0 "((rpm > fsio_setting(4) & (fsio_input < fsio_setting(5)) | rpm > fsio_setting(1) | (coolant > fsio_setting(2) > | (vbatt < fsio_setting(3)"
|
||||
|
||||
// todo: convert
|
||||
setFsio(0, GPIOC_13, "rpm 3 fsio_setting > fsio_input 4 fsio_setting < & rpm 0 fsio_setting | > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |" PASS_ENGINE_PARAMETER);
|
||||
setFsio(0, GPIOC_13, "rpm 3 fsio_setting > fsio_input 4 fsio_setting < & rpm 0 fsio_setting | > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |" PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
boardConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
|
||||
boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setMazdaMiataNb1EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setMazdaMiataNb1EngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
// set_rpm_hard_limit 3000
|
||||
engineConfiguration->rpmHardLimit = 3000; // yes, 3k. let's play it safe for now
|
||||
|
||||
|
@ -75,7 +75,7 @@ void setMazdaMiataNb1EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->clutchDownPin = GPIO_UNASSIGNED;
|
||||
|
||||
// set_whole_fuel_map 3
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
// 10 deg before TDC is default timing
|
||||
|
@ -88,5 +88,5 @@ void setMazdaMiataNb1EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->fsio_setting[0] = 5000;
|
||||
// (self and (rpm > 4800)) OR (rpm > 5000)
|
||||
// set_rpn_expression 1 "self rpm 4800 > & rpm 5000 > OR"
|
||||
// setFsioExt(0, GPIOE_3, "self rpm 4800 > & rpm 5000 > OR", 150 PASS_ENGINE_PARAMETER);
|
||||
// setFsioExt(0, GPIOE_3, "self rpm 4800 > & rpm 5000 > OR", 150 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ static const ignition_table_t mapBased18vvtTimingTable = {
|
|||
{/* 15 250.000 *//* 0 700.0*/1.100, /* 1 850.0*/1.400, /* 2 943.0*/1.600, /* 3 1112.0*/2.000, /* 4 1310.0*/2.500, /* 5 1545.0*/3.000, /* 6 1821.0*/3.700, /* 7 2146.0*/4.400, /* 8 2530.0*/5.400, /* 9 2982.0*/6.600, /* 10 3515.0*/7.600, /* 11 4144.0*/9.000, /* 12 4884.0*/10.500, /* 13 5757.0*/12.000, /* 14 6787.0*/13.400, /* 15 8000.0*/14.900, },
|
||||
};
|
||||
|
||||
void setMazdaMiataNbTpsTps(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setMazdaMiataNbTpsTps(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
memcpy(config->tpsTpsAccelFromRpmBins, tpsTspSame, sizeof(tpsTspSame));
|
||||
memcpy(config->tpsTpsAccelFromRpmBins, tpsTspSame, sizeof(tpsTspSame));
|
||||
// todo: there should be a better way?
|
||||
|
@ -224,13 +224,13 @@ void setMazdaMiataNbTpsTps(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
}
|
||||
|
||||
void setMazdaMiataNbInjectorLag(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setMazdaMiataNbInjectorLag(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
memcpy(engineConfiguration->injector.battLagCorr, injectorLagCorrection, sizeof(injectorLagCorrection));
|
||||
memcpy(engineConfiguration->injector.battLagCorrBins, injectorLagBins, sizeof(injectorLagBins));
|
||||
}
|
||||
|
||||
void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->trigger.type = TT_MIATA_VVT;
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR);
|
||||
|
@ -277,7 +277,7 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// * set_fsio_setting 1 0.55
|
||||
// */
|
||||
boardConfiguration->fsio_setting[0] = 0.0;
|
||||
// setFsioExt(0, GPIOE_3, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER);
|
||||
// setFsioExt(0, GPIOE_3, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
|
||||
|
@ -320,10 +320,10 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
}
|
||||
|
||||
setMazdaMiataNbTpsTps(PASS_ENGINE_PARAMETER_F);
|
||||
setMazdaMiataNbTpsTps(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
setMazdaMiataNbInjectorLag(PASS_ENGINE_PARAMETER_F);
|
||||
setMazdaMiataNbInjectorLag(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->tpsMin = 100; // convert 12to10 bit (ADC/4)
|
||||
engineConfiguration->tpsMax = 650; // convert 12to10 bit (ADC/4)
|
||||
|
@ -368,7 +368,7 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// todo: re-wire the board to use default input channel!
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_4;
|
||||
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
//
|
||||
/**
|
||||
|
@ -383,13 +383,13 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->fsio_setting[2] = 105; // #3 CLT threshold
|
||||
boardConfiguration->fsio_setting[3] = 12.0; // #4 voltage threshold
|
||||
|
||||
setFsio(1, GPIOE_6, COMBINED_WARNING_LIGHT PASS_ENGINE_PARAMETER);
|
||||
setFsio(1, GPIOE_6, COMBINED_WARNING_LIGHT PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void setMazdaMiata2003EngineConfigurationNewBoard(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setMazdaMiata2003EngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setMazdaMiata2003EngineConfigurationNewBoard(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setMazdaMiata2003EngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// todo: there should be a better way?
|
||||
for (int loadIndex = 0; loadIndex < FSIO_TABLE_8; loadIndex++) {
|
||||
|
@ -413,7 +413,7 @@ void setMazdaMiata2003EngineConfigurationNewBoard(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_4; // PA4
|
||||
|
||||
setEgoSensor(ES_14Point7_Free PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_14Point7_Free PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
// set cranking_fuel 9
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->engineType = MITSU_4G93;
|
||||
|
||||
engineConfiguration->trigger.type = TT_MITSUBISHI; // same trigger as 4G63?
|
||||
|
@ -38,7 +38,7 @@ void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->crankingTimingAngle = -715;
|
||||
|
||||
// set_whole_fuel_map 3
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// set cranking_fuel 4
|
||||
engineConfiguration->cranking.baseFuel = 4;
|
||||
|
@ -85,9 +85,9 @@ void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->HD44780width = 20;
|
||||
engineConfiguration->HD44780height = 4;
|
||||
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||
setFsio(0, GPIOD_11, "rpm 5500 >" PASS_ENGINE_PARAMETER);
|
||||
setFsio(0, GPIOD_11, "rpm 5500 >" PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ void setFrankenstein_01_LCD(board_configuration_s *boardConfiguration) {
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setRoverv8(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setRoverv8(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
// set trigger_type 9
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_1;
|
||||
|
@ -48,7 +48,7 @@ void setRoverv8(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->cranking.rpm = 350;
|
||||
|
||||
// set_whole_fuel_map 3
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// set cranking_injection_mode 0
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
|
@ -134,7 +134,7 @@ void setRoverv8(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
|
||||
|
||||
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// todo: make this official Frankenstein joystick?
|
||||
boardConfiguration->joystickCenterPin = GPIOD_8;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setSachs(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setSachs(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->specs.displacement = 0.1; // 100cc
|
||||
engineConfiguration->specs.cylindersCount = 1;
|
||||
|
||||
|
@ -25,7 +25,7 @@ void setSachs(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// set injection_offset 0
|
||||
engineConfiguration->extraInjectionOffset = 0;
|
||||
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
/**
|
||||
* 50/2 trigger
|
||||
|
@ -81,8 +81,8 @@ void setSachs(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->fuelPumpPin = GPIOE_6;
|
||||
|
||||
// todo: extract a method? figure out something smarter
|
||||
setFuelRpmBin(800, 15000 PASS_ENGINE_PARAMETER);
|
||||
setTimingRpmBin(800, 15000 PASS_ENGINE_PARAMETER);
|
||||
setFuelRpmBin(800, 15000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingRpmBin(800, 15000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTableBin2(config->veRpmBins, FUEL_RPM_COUNT, 15000, 7000, 1);
|
||||
setTableBin2(config->afrRpmBins, FUEL_RPM_COUNT, 15000, 7000, 1);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setTestEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setTestEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
||||
engineConfiguration->trigger.type = TT_ONE_PLUS_ONE;
|
||||
|
@ -32,10 +32,10 @@ void setTestEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_NONE;
|
||||
|
||||
setWholeIatCorrTimingTable(0 PASS_ENGINE_PARAMETER);
|
||||
setWholeIatCorrTimingTable(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
||||
setConstantDwell(3 PASS_ENGINE_PARAMETER); // 50% duty cycle @ 5000 rpm
|
||||
setConstantDwell(3 PASS_ENGINE_PARAMETER_SUFFIX); // 50% duty cycle @ 5000 rpm
|
||||
|
||||
board_configuration_s *bc = &engineConfiguration->bc;
|
||||
bc->malfunctionIndicatorPin = GPIO_UNASSIGNED;
|
||||
|
@ -53,7 +53,7 @@ void setTestEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->logicAnalyzerPins[3] = GPIO_UNASSIGNED;
|
||||
}
|
||||
|
||||
void setTestVVTEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setTestVVTEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
|
@ -61,7 +61,7 @@ void setTestVVTEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->trigger.customSkippedToothCount = 1;
|
||||
|
||||
// set algorithm 3
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->camInput = GPIOA_5;
|
||||
|
@ -74,8 +74,8 @@ void setTestVVTEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
|
||||
#if EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||
void setTestEngineIssue366both(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setTestEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setTestEngineIssue366both(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setTestEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||
|
@ -86,8 +86,8 @@ void setTestEngineIssue366both(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
}
|
||||
|
||||
void setTestEngineIssue366rise(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setTestEngineIssue366both(PASS_ENGINE_PARAMETER_F);
|
||||
void setTestEngineIssue366rise(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setTestEngineIssue366both(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setVwAba(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
void setVwAba(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
setWholeTimingTable(20 PASS_ENGINE_PARAMETER);
|
||||
setWholeTimingTable(20 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engineConfiguration->cranking.baseFuel = 12;
|
||||
// set cranking_timing_angle 10
|
||||
engineConfiguration->crankingTimingAngle = 10;
|
||||
|
@ -26,7 +26,7 @@ void setVwAba(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->isCylinderCleanupEnabled = true;
|
||||
|
||||
// set_whole_fuel_map 12
|
||||
setWholeFuelMap(12 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(12 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// set global_trigger_offset_angle 93
|
||||
engineConfiguration->globalTriggerAngleOffset = 93;
|
||||
|
@ -44,7 +44,7 @@ void setVwAba(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->specs.displacement = 2.0;
|
||||
engineConfiguration->injector.flow = 320; // 30lb/h
|
||||
// set algorithm 3
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engineConfiguration->map.sensor.type = MT_GM_3_BAR;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
||||
|
@ -57,9 +57,9 @@ void setVwAba(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
float mapRange = 110;
|
||||
|
||||
setEgoSensor(ES_PLX PASS_ENGINE_PARAMETER);
|
||||
setFuelTablesLoadBin(20, mapRange PASS_ENGINE_PARAMETER);
|
||||
setTimingLoadBin(20, mapRange PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_PLX PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelTablesLoadBin(20, mapRange PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingLoadBin(20, mapRange PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
boardConfiguration->isSdCardEnabled = false;
|
||||
engineConfiguration->tpsMin = 740;
|
||||
|
|
|
@ -158,7 +158,7 @@ static char buf[6];
|
|||
* This is useful if we are changing engine mode dynamically
|
||||
* For example http://rusefi.com/forum/viewtopic.php?f=5&t=1085
|
||||
*/
|
||||
static int packEngineMode(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static int packEngineMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return (engineConfiguration->fuelAlgorithm << 4) +
|
||||
(engineConfiguration->injectionMode << 2) +
|
||||
engineConfiguration->ignitionMode;
|
||||
|
@ -183,29 +183,29 @@ static void printSensors(Logging *log, bool fileFormat) {
|
|||
reportSensorF(log, fileFormat, GAUGE_NAME_CPU_TEMP, "C", getMCUInternalTemperature(), 2); // log column #3
|
||||
#endif
|
||||
|
||||
reportSensorI(log, fileFormat, "mode", "v", packEngineMode(PASS_ENGINE_PARAMETER_F)); // log column #3
|
||||
reportSensorI(log, fileFormat, "mode", "v", packEngineMode(PASS_ENGINE_PARAMETER_SIGNATURE)); // log column #3
|
||||
|
||||
if (hasCltSensor()) {
|
||||
reportSensorF(log, fileFormat, "CLT", "C", getCoolantTemperature(PASS_ENGINE_PARAMETER_F), 2); // log column #4
|
||||
reportSensorF(log, fileFormat, "CLT", "C", getCoolantTemperature(PASS_ENGINE_PARAMETER_SIGNATURE), 2); // log column #4
|
||||
}
|
||||
if (hasTpsSensor()) {
|
||||
reportSensorF(log, fileFormat, "TPS", "%", getTPS(PASS_ENGINE_PARAMETER_F), 2); // log column #5
|
||||
reportSensorF(log, fileFormat, "TPS", "%", getTPS(PASS_ENGINE_PARAMETER_SIGNATURE), 2); // log column #5
|
||||
}
|
||||
|
||||
if (hasVBatt(PASS_ENGINE_PARAMETER_F)) {
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_VBAT, "V", getVBatt(PASS_ENGINE_PARAMETER_F), 2); // log column #6
|
||||
if (hasVBatt(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_VBAT, "V", getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE), 2); // log column #6
|
||||
}
|
||||
|
||||
if (hasIatSensor()) {
|
||||
reportSensorF(log, fileFormat, "IAT", "C", getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F), 2); // log column #7
|
||||
reportSensorF(log, fileFormat, "IAT", "C", getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE), 2); // log column #7
|
||||
}
|
||||
|
||||
if (hasMafSensor()) {
|
||||
reportSensorF(log, fileFormat, "maf", "V", getMaf(PASS_ENGINE_PARAMETER_F), 2);
|
||||
reportSensorF(log, fileFormat, "mafr", "kg/hr", getRealMaf(PASS_ENGINE_PARAMETER_F), 2);
|
||||
reportSensorF(log, fileFormat, "maf", "V", getMaf(PASS_ENGINE_PARAMETER_SIGNATURE), 2);
|
||||
reportSensorF(log, fileFormat, "mafr", "kg/hr", getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE), 2);
|
||||
}
|
||||
#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__)
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
reportSensorF(log, fileFormat, "MAP", "kPa", getMap(), 2);
|
||||
// reportSensorF(log, fileFormat, "map_r", "V", getRawMap(), 2);
|
||||
}
|
||||
|
@ -216,8 +216,8 @@ static void printSensors(Logging *log, bool fileFormat) {
|
|||
}
|
||||
#endif /* EFI_ANALOG_SENSORS */
|
||||
|
||||
if (hasAfrSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
reportSensorF(log, fileFormat, "afr", "AFR", getAfr(PASS_ENGINE_PARAMETER_F), 2);
|
||||
if (hasAfrSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
reportSensorF(log, fileFormat, "afr", "AFR", getAfr(PASS_ENGINE_PARAMETER_SIGNATURE), 2);
|
||||
}
|
||||
|
||||
#if EFI_IDLE_CONTROL || defined(__DOXYGEN__)
|
||||
|
@ -247,13 +247,13 @@ static void printSensors(Logging *log, bool fileFormat) {
|
|||
#endif /* EFI_TUNER_STUDIO */
|
||||
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_TCHARGE, "K", engine->engineState.tChargeK, 2); // log column #8
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_VR, "%", veMap.getValue(rpm, getMap()), 2);
|
||||
}
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_VVT, "deg", engine->triggerCentral.vvtPosition, 1);
|
||||
}
|
||||
|
||||
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F);
|
||||
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_ENGINE_LOAD, "x", engineLoad, 2);
|
||||
|
||||
|
||||
|
@ -264,7 +264,7 @@ static void printSensors(Logging *log, bool fileFormat) {
|
|||
}
|
||||
|
||||
if (fileFormat) {
|
||||
floatms_t fuelBase = getBaseFuel(rpm PASS_ENGINE_PARAMETER);
|
||||
floatms_t fuelBase = getBaseFuel(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
reportSensorF(log, fileFormat, "f: base", "ms", fuelBase, 2);
|
||||
reportSensorF(log, fileFormat, "f: actual", "ms", ENGINE(actualLastInjection), 2);
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_INJECTOR_LAG, "ms", engine->engineState.injectorLag, 2);
|
||||
|
@ -296,12 +296,12 @@ static void printSensors(Logging *log, bool fileFormat) {
|
|||
reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_TPS_EXTRA, "ms", engine->engineState.tpsAccelEnrich, 2);
|
||||
|
||||
reportSensorF(log, fileFormat, "f: el delta", "v", engine->engineLoadAccelEnrichment.getMaxDelta(), 2);
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
reportSensorF(log, fileFormat, "f: el fuel", "v", engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap(), 2);
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
reportSensorF(log, fileFormat, "f: el fuel", "v", engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE) * 100 / getMap(), 2);
|
||||
}
|
||||
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_INJ_DUTY, "%", getInjectorDutyCycle(rpm PASS_ENGINE_PARAMETER), 2);
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_DWELL_DUTY, "%", getCoilDutyCycle(rpm PASS_ENGINE_PARAMETER), 2);
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_INJ_DUTY, "%", getInjectorDutyCycle(rpm PASS_ENGINE_PARAMETER_SUFFIX), 2);
|
||||
reportSensorF(log, fileFormat, GAUGE_NAME_DWELL_DUTY, "%", getCoilDutyCycle(rpm PASS_ENGINE_PARAMETER_SUFFIX), 2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -516,9 +516,9 @@ static void showFuelInfo2(float rpm, float engineLoad) {
|
|||
|
||||
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
||||
scheduleMsg(&logger, "base cranking fuel %f", engineConfiguration->cranking.baseFuel);
|
||||
scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(PASS_ENGINE_PARAMETER_F));
|
||||
scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
if (engine->rpmCalculator.isRunning(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (engine->rpmCalculator.isRunning(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
float iatCorrection = engine->engineState.iatFuelCorrection;
|
||||
float cltCorrection = engine->engineState.cltFuelCorrection;
|
||||
floatms_t injectorLag = engine->engineState.injectorLag;
|
||||
|
@ -528,7 +528,7 @@ static void showFuelInfo2(float rpm, float engineLoad) {
|
|||
scheduleMsg(&logger2, "iatCorrection=%f cltCorrection=%f injectorLag=%f", iatCorrection, cltCorrection,
|
||||
injectorLag);
|
||||
|
||||
float value = getRunningFuel(baseFuelMs PASS_ENGINE_PARAMETER);
|
||||
float value = getRunningFuel(baseFuelMs PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
scheduleMsg(&logger2, "injection pulse width: %f", value);
|
||||
}
|
||||
#endif
|
||||
|
@ -536,7 +536,7 @@ static void showFuelInfo2(float rpm, float engineLoad) {
|
|||
|
||||
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
||||
static void showFuelInfo(void) {
|
||||
showFuelInfo2((float) getRpmE(engine), getEngineLoadT(PASS_ENGINE_PARAMETER_F));
|
||||
showFuelInfo2((float) getRpmE(engine), getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -662,18 +662,18 @@ extern int invalidResponsesCount;
|
|||
|
||||
#if EFI_TUNER_STUDIO || defined(__DOXYGEN__)
|
||||
|
||||
void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ENGINE_PARAMETER_S) {
|
||||
void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__)
|
||||
int rpm = getRpmE(engine);
|
||||
#else
|
||||
int rpm = 0;
|
||||
#endif
|
||||
|
||||
float tps = getTPS(PASS_ENGINE_PARAMETER_F);
|
||||
float coolant = getCoolantTemperature(PASS_ENGINE_PARAMETER_F);
|
||||
float intake = getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F);
|
||||
float tps = getTPS(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
float coolant = getCoolantTemperature(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
float intake = getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F);
|
||||
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// header
|
||||
tsOutputChannels->tsConfigVersion = TS_FILE_VERSION;
|
||||
|
@ -683,21 +683,21 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->coolantTemperature = coolant;
|
||||
tsOutputChannels->intakeAirTemperature = intake;
|
||||
tsOutputChannels->throttlePositon = tps;
|
||||
tsOutputChannels->massAirFlowVoltage = hasMafSensor() ? getMaf(PASS_ENGINE_PARAMETER_F) : 0;
|
||||
tsOutputChannels->massAirFlow = hasMafSensor() ? getRealMaf(PASS_ENGINE_PARAMETER_F) : 0;
|
||||
tsOutputChannels->massAirFlowVoltage = hasMafSensor() ? getMaf(PASS_ENGINE_PARAMETER_SIGNATURE) : 0;
|
||||
tsOutputChannels->massAirFlow = hasMafSensor() ? getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE) : 0;
|
||||
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
float mapValue = getMap();
|
||||
tsOutputChannels->veValue = veMap.getValue(rpm, mapValue);
|
||||
// todo: bug here? target afr could work based on real MAF?
|
||||
tsOutputChannels->currentTargetAfr = afrMap.getValue(rpm, mapValue);
|
||||
tsOutputChannels->manifoldAirPressure = mapValue;
|
||||
}
|
||||
tsOutputChannels->airFuelRatio = getAfr(PASS_ENGINE_PARAMETER_F);
|
||||
if (hasVBatt(PASS_ENGINE_PARAMETER_F)) {
|
||||
tsOutputChannels->vBatt = getVBatt(PASS_ENGINE_PARAMETER_F);
|
||||
tsOutputChannels->airFuelRatio = getAfr(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
if (hasVBatt(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
tsOutputChannels->vBatt = getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
tsOutputChannels->tpsADC = getTPS12bitAdc(PASS_ENGINE_PARAMETER_F) / TPS_TS_CONVERSION;
|
||||
tsOutputChannels->tpsADC = getTPS12bitAdc(PASS_ENGINE_PARAMETER_SIGNATURE) / TPS_TS_CONVERSION;
|
||||
#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__)
|
||||
tsOutputChannels->baroPressure = hasBaroSensor() ? getBaroPressure() : 0;
|
||||
#endif /* EFI_ANALOG_SENSORS */
|
||||
|
@ -705,7 +705,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->rpmAcceleration = engine->rpmCalculator.getRpmAcceleration();
|
||||
tsOutputChannels->triggerErrorsCounter = engine->triggerCentral.triggerState.totalTriggerErrorCounter;
|
||||
tsOutputChannels->baroCorrection = engine->engineState.baroCorrection;
|
||||
tsOutputChannels->pedalPosition = hasPedalPositionSensor(PASS_ENGINE_PARAMETER_F) ? getPedalPosition(PASS_ENGINE_PARAMETER_F) : 0;
|
||||
tsOutputChannels->pedalPosition = hasPedalPositionSensor(PASS_ENGINE_PARAMETER_SIGNATURE) ? getPedalPosition(PASS_ENGINE_PARAMETER_SIGNATURE) : 0;
|
||||
tsOutputChannels->knockCount = engine->knockCount;
|
||||
tsOutputChannels->knockLevel = engine->knockVolts;
|
||||
tsOutputChannels->fuelTankGauge = engine->sensors.fuelTankGauge;
|
||||
|
@ -713,14 +713,14 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->hasFatalError = hasFirmwareError();
|
||||
tsOutputChannels->totalTriggerErrorCounter = engine->triggerCentral.triggerState.totalTriggerErrorCounter;
|
||||
|
||||
tsOutputChannels->injectorDutyCycle = getInjectorDutyCycle(rpm PASS_ENGINE_PARAMETER);
|
||||
tsOutputChannels->injectorDutyCycle = getInjectorDutyCycle(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
tsOutputChannels->fuelRunning = ENGINE(engineState.runningFuel);
|
||||
tsOutputChannels->fuelPidCorrection = ENGINE(engineState.fuelPidCorrection);
|
||||
tsOutputChannels->injectorLagMs = ENGINE(engineState.injectorLag);
|
||||
tsOutputChannels->fuelBase = engine->engineState.baseFuel;
|
||||
tsOutputChannels->actualLastInjection = ENGINE(actualLastInjection);
|
||||
|
||||
tsOutputChannels->coilDutyCycle = getCoilDutyCycle(rpm PASS_ENGINE_PARAMETER);
|
||||
tsOutputChannels->coilDutyCycle = getCoilDutyCycle(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
efitimesec_t now = getTimeNowSeconds();
|
||||
tsOutputChannels->timeSeconds = now;
|
||||
|
@ -774,8 +774,8 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getMaxDelta();
|
||||
tsOutputChannels->tpsAccelFuel = engine->engineState.tpsAccelEnrich;
|
||||
// engine load acceleration
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
tsOutputChannels->engineLoadAccelExtra = engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap();
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
tsOutputChannels->engineLoadAccelExtra = engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE) * 100 / getMap();
|
||||
}
|
||||
tsOutputChannels->engineLoadDelta = engine->engineLoadAccelEnrichment.getMaxDelta();
|
||||
|
||||
|
@ -787,7 +787,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
|
||||
tsOutputChannels->vvtPosition = engine->triggerCentral.vvtPosition;
|
||||
|
||||
tsOutputChannels->engineMode = packEngineMode(PASS_ENGINE_PARAMETER_F);
|
||||
tsOutputChannels->engineMode = packEngineMode(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
tsOutputChannels->internalMcuTemperature = getMCUInternalTemperature();
|
||||
|
@ -819,8 +819,8 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->speedToRpmRatio = vehicleSpeed / rpm;
|
||||
|
||||
#endif /* EFI_VEHICLE_SPEED */
|
||||
tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature(PASS_ENGINE_PARAMETER_F));
|
||||
tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F));
|
||||
tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
tsOutputChannels->warningCounter = engine->engineState.warningCounter;
|
||||
|
@ -833,11 +833,11 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->clutchDownState = engine->clutchDownState;
|
||||
tsOutputChannels->brakePedalState = engine->brakePedalState;
|
||||
|
||||
tsOutputChannels->tCharge = getTCharge(rpm, tps, coolant, intake PASS_ENGINE_PARAMETER);
|
||||
tsOutputChannels->tCharge = getTCharge(rpm, tps, coolant, intake PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
float timing = engine->engineState.timingAdvance;
|
||||
tsOutputChannels->ignitionAdvance = timing > 360 ? timing - 720 : timing;
|
||||
tsOutputChannels->sparkDwell = ENGINE(engineState.sparkDwell);
|
||||
tsOutputChannels->crankingFuelMs = engine->isCylinderCleanupMode ? 0 : getCrankingFuel(PASS_ENGINE_PARAMETER_F);
|
||||
tsOutputChannels->crankingFuelMs = engine->isCylinderCleanupMode ? 0 : getCrankingFuel(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
tsOutputChannels->chargeAirMass = engine->engineState.airMass;
|
||||
}
|
||||
|
||||
|
@ -845,7 +845,7 @@ extern TunerStudioOutputChannels tsOutputChannels;
|
|||
|
||||
void prepareTunerStudioOutputs(void) {
|
||||
// sensor state for EFI Analytics Tuner Studio
|
||||
updateTunerStudioState(&tsOutputChannels PASS_ENGINE_PARAMETER);
|
||||
updateTunerStudioState(&tsOutputChannels PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
#endif /* EFI_TUNER_STUDIO */
|
||||
|
|
|
@ -47,7 +47,7 @@ void WallFuel::reset() {
|
|||
memset(wallFuel, 0, sizeof(wallFuel));
|
||||
}
|
||||
|
||||
floatms_t WallFuel::adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t WallFuel::adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (cisnan(target)) {
|
||||
return target;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ floatms_t WallFuel::getWallFuel(int injectorIndex) {
|
|||
return wallFuel[injectorIndex];
|
||||
}
|
||||
|
||||
int AccelEnrichmemnt::getMaxDeltaIndex(DECLARE_ENGINE_PARAMETER_F) {
|
||||
int AccelEnrichmemnt::getMaxDeltaIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
||||
int len = minI(cb.getSize(), cb.getCount());
|
||||
if (len < 2)
|
||||
|
@ -93,15 +93,15 @@ int AccelEnrichmemnt::getMaxDeltaIndex(DECLARE_ENGINE_PARAMETER_F) {
|
|||
return resultIndex;
|
||||
}
|
||||
|
||||
float AccelEnrichmemnt::getMaxDelta(DECLARE_ENGINE_PARAMETER_F) {
|
||||
int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_F);
|
||||
float AccelEnrichmemnt::getMaxDelta(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
return (cb.get(index) - (cb.get(index - 1))) * CONFIG(specs.cylindersCount);
|
||||
}
|
||||
|
||||
// todo: eliminate code duplication between these two methods! Some pointer magic would help.
|
||||
floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
||||
int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_F);
|
||||
floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// FuelSchedule *fs = engine->engineConfiguration2->injectionEvents;
|
||||
float tpsTo = cb.get(index);
|
||||
|
@ -132,8 +132,8 @@ floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
|||
return extraFuel;
|
||||
}
|
||||
|
||||
float AccelEnrichmemnt::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
||||
int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_F);
|
||||
float AccelEnrichmemnt::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
float d = (cb.get(index) - (cb.get(index - 1))) * CONFIG(specs.cylindersCount);
|
||||
|
||||
|
@ -173,16 +173,16 @@ void AccelEnrichmemnt::setLength(int length) {
|
|||
cb.setSize(length);
|
||||
}
|
||||
|
||||
void AccelEnrichmemnt::onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S) {
|
||||
void AccelEnrichmemnt::onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
cb.add(currentValue);
|
||||
}
|
||||
|
||||
void AccelEnrichmemnt::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_F) {
|
||||
onNewValue(getTPS(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER);
|
||||
void AccelEnrichmemnt::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
onNewValue(getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void AccelEnrichmemnt::onEngineCycle(DECLARE_ENGINE_PARAMETER_F) {
|
||||
onNewValue(getEngineLoadT(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER);
|
||||
void AccelEnrichmemnt::onEngineCycle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
onNewValue(getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
AccelEnrichmemnt::AccelEnrichmemnt() {
|
||||
|
@ -266,7 +266,7 @@ void updateAccelParameters() {
|
|||
#endif /* ! EFI_UNIT_TEST */
|
||||
|
||||
|
||||
void initAccelEnrichment(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initAccelEnrichment(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
logger = sharedLogger;
|
||||
tpsTpsMap.init(config->tpsTpsAccelTable, config->tpsTpsAccelFromRpmBins, config->tpsTpsAccelToRpmBins);
|
||||
|
||||
|
|
|
@ -55,14 +55,14 @@ static const ignition_table_t defaultIatTiming = {
|
|||
{-4.4, -4.9, -5.9, -5.9, -5.9, -5.9, -4.9, -4.9, -4.9, -4.9, -4.9, -3.9, -3.9, -3.9, -3.9, -3.9},
|
||||
};
|
||||
|
||||
bool isStep1Condition(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
bool isStep1Condition(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
return boardConfiguration->enabledStep1Limiter && rpm >= engineConfiguration->step1rpm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ignition timing angle advance before TDC
|
||||
*/
|
||||
static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
||||
static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
engine->m.beforeAdvance = GET_TIMESTAMP();
|
||||
if (cisnan(engineLoad)) {
|
||||
warning(CUSTOM_NAN_ENGINE_LOAD, "NaN engine load");
|
||||
|
@ -73,7 +73,7 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
|
|||
engine->m.beforeZeroTest = GET_TIMESTAMP();
|
||||
engine->m.zeroTestTime = GET_TIMESTAMP() - engine->m.beforeZeroTest;
|
||||
|
||||
if (isStep1Condition(rpm PASS_ENGINE_PARAMETER)) {
|
||||
if (isStep1Condition(rpm PASS_ENGINE_PARAMETER_SUFFIX)) {
|
||||
return engineConfiguration->step1timing;
|
||||
}
|
||||
|
||||
|
@ -99,13 +99,13 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
|
|||
return result;
|
||||
}
|
||||
|
||||
angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
||||
angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
angle_t angle;
|
||||
if (isCrankingR(rpm)) {
|
||||
angle = engineConfiguration->crankingTimingAngle;
|
||||
} else {
|
||||
if (CONFIG(timingMode) == TM_DYNAMIC) {
|
||||
angle = getRunningAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
|
||||
angle = getRunningAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
} else {
|
||||
angle = engineConfiguration->fixedTiming;
|
||||
}
|
||||
|
@ -115,13 +115,13 @@ angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
|||
return angle;
|
||||
}
|
||||
|
||||
void setDefaultIatTimingCorrection(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setDefaultIatTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setTableBin2(config->ignitionIatCorrLoadBins, IGN_LOAD_COUNT, -40, 110, 1);
|
||||
memcpy(config->ignitionIatCorrRpmBins, iatTimingRpmBins, sizeof(iatTimingRpmBins));
|
||||
copyTimingTable(defaultIatTiming, config->ignitionIatCorrTable);
|
||||
}
|
||||
|
||||
void prepareTimingMap(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void prepareTimingMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
advanceMap.init(config->ignitionTable, config->ignitionLoadBins,
|
||||
config->ignitionRpmBins);
|
||||
iatAdvanceCorrectionMap.init(config->ignitionIatCorrTable, config->ignitionIatCorrLoadBins,
|
||||
|
@ -190,7 +190,7 @@ float getInitialAdvance(int rpm, float map, float advanceMax) {
|
|||
/**
|
||||
* this method builds a good-enough base timing advance map bases on a number of heuristics
|
||||
*/
|
||||
void buildTimingMap(float advanceMax DECLARE_ENGINE_PARAMETER_S) {
|
||||
void buildTimingMap(float advanceMax DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (engineConfiguration->fuelAlgorithm != LM_SPEED_DENSITY &&
|
||||
engineConfiguration->fuelAlgorithm != LM_MAP) {
|
||||
warning(CUSTOM_WRONG_ALGORITHM, "wrong algorithm for MAP-based timing");
|
||||
|
|
|
@ -60,12 +60,12 @@ int MockAdcState::getMockAdcValue(int hwChannel) {
|
|||
* We are executing these heavy (logarithm) methods from outside the trigger callbacks for performance reasons.
|
||||
* See also periodicFastCallback
|
||||
*/
|
||||
void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
int rpm = rpmCalculator.rpmValue;
|
||||
isEngineChartEnabled = CONFIG(isEngineChartEnabled) && rpm < CONFIG(engineSnifferRpmThreshold);
|
||||
sensorChartMode = rpm < CONFIG(sensorSnifferRpmThreshold) ? boardConfiguration->sensorChartMode : SC_OFF;
|
||||
|
||||
engineState.updateSlowSensors(PASS_ENGINE_PARAMETER_F);
|
||||
engineState.updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
if (engineConfiguration->fuelLevelSensor != EFI_ADC_NONE) {
|
||||
float fuelLevelVoltage = getVoltageDivided("fuel", engineConfiguration->fuelLevelSensor);
|
||||
|
@ -73,9 +73,9 @@ void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->fuelLevelFullTankVoltage, 100,
|
||||
fuelLevelVoltage);
|
||||
}
|
||||
sensors.vBatt = hasVBatt(PASS_ENGINE_PARAMETER_F) ? getVBatt(PASS_ENGINE_PARAMETER_F) : 12;
|
||||
sensors.vBatt = hasVBatt(PASS_ENGINE_PARAMETER_SIGNATURE) ? getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE) : 12;
|
||||
|
||||
engineState.injectorLag = getInjectorLag(sensors.vBatt PASS_ENGINE_PARAMETER);
|
||||
engineState.injectorLag = getInjectorLag(sensors.vBatt PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void Engine::onTriggerEvent(efitick_t nowNt) {
|
||||
|
@ -163,15 +163,15 @@ EngineState::EngineState() {
|
|||
totalLoggedBytes = injectionOffset = 0;
|
||||
}
|
||||
|
||||
void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_F) {
|
||||
engine->sensors.iat = getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F);
|
||||
engine->sensors.clt = getCoolantTemperature(PASS_ENGINE_PARAMETER_F);
|
||||
void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engine->sensors.iat = getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
engine->sensors.clt = getCoolantTemperature(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
warmupTargetAfr = interpolate2d(engine->sensors.clt, engineConfiguration->warmupTargetAfrBins,
|
||||
engineConfiguration->warmupTargetAfr, WARMUP_TARGET_AFR_SIZE);
|
||||
}
|
||||
|
||||
void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
int rpm = ENGINE(rpmCalculator.rpmValue);
|
||||
|
||||
efitick_t nowNt = getTimeNowNt();
|
||||
|
@ -181,12 +181,12 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
|
|||
timeSinceCranking = nowNt - crankingTime;
|
||||
}
|
||||
|
||||
sparkDwell = getSparkDwell(rpm PASS_ENGINE_PARAMETER);
|
||||
sparkDwell = getSparkDwell(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
dwellAngle = sparkDwell / getOneDegreeTimeMs(rpm);
|
||||
engine->sensors.currentAfr = getAfr(PASS_ENGINE_PARAMETER_F);
|
||||
engine->sensors.currentAfr = getAfr(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// todo: move this into slow callback, no reason for IAT corr to be here
|
||||
iatFuelCorrection = getIatFuelCorrection(engine->sensors.iat PASS_ENGINE_PARAMETER);
|
||||
iatFuelCorrection = getIatFuelCorrection(engine->sensors.iat PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// todo: move this into slow callback, no reason for CLT corr to be here
|
||||
if (boardConfiguration->useWarmupPidAfr && engine->sensors.clt < engineConfiguration->warmupAfrThreshold) {
|
||||
if (rpm < 200) {
|
||||
|
@ -203,25 +203,25 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
|
|||
#endif
|
||||
|
||||
} else {
|
||||
cltFuelCorrection = getCltFuelCorrection(PASS_ENGINE_PARAMETER_F);
|
||||
cltFuelCorrection = getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
cltTimingCorrection = getCltTimingCorrection(PASS_ENGINE_PARAMETER_F);
|
||||
cltTimingCorrection = getCltTimingCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineNoiseHipLevel = interpolate2d(rpm, engineConfiguration->knockNoiseRpmBins,
|
||||
engineConfiguration->knockNoise, ENGINE_NOISE_CURVE_SIZE);
|
||||
|
||||
baroCorrection = getBaroCorrection(PASS_ENGINE_PARAMETER_F);
|
||||
baroCorrection = getBaroCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
injectionOffset = getinjectionOffset(rpm PASS_ENGINE_PARAMETER);
|
||||
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F);
|
||||
timingAdvance = getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
|
||||
injectionOffset = getinjectionOffset(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
timingAdvance = getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
if (engineConfiguration->fuelAlgorithm == LM_SPEED_DENSITY) {
|
||||
float coolantC = ENGINE(sensors.clt);
|
||||
float intakeC = ENGINE(sensors.iat);
|
||||
float tps = getTPS(PASS_ENGINE_PARAMETER_F);
|
||||
tChargeK = convertCelsiusToKelvin(getTCharge(rpm, tps, coolantC, intakeC PASS_ENGINE_PARAMETER));
|
||||
float tps = getTPS(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
tChargeK = convertCelsiusToKelvin(getTCharge(rpm, tps, coolantC, intakeC PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
float map = getMap();
|
||||
|
||||
/**
|
||||
|
@ -335,7 +335,7 @@ void Engine::watchdog() {
|
|||
#endif
|
||||
}
|
||||
|
||||
injection_mode_e Engine::getCurrentInjectionMode(DECLARE_ENGINE_PARAMETER_F) {
|
||||
injection_mode_e Engine::getCurrentInjectionMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
int rpm = rpmCalculator.rpmValue;
|
||||
return isCrankingR(rpm) ? CONFIG(crankingInjectionMode) : CONFIG(injectionMode);
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ injection_mode_e Engine::getCurrentInjectionMode(DECLARE_ENGINE_PARAMETER_F) {
|
|||
* The idea of this method is to execute all heavy calculations in a lower-priority thread,
|
||||
* so that trigger event handler/IO scheduler tasks are faster.
|
||||
*/
|
||||
void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
int rpm = rpmCalculator.rpmValue;
|
||||
|
||||
if (isValidRpm(rpm)) {
|
||||
|
@ -367,10 +367,10 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engine->engineState.mapAveragingDuration = NAN;
|
||||
}
|
||||
|
||||
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engine->m.beforeFuelCalc = GET_TIMESTAMP();
|
||||
ENGINE(fuelMs) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER) * engineConfiguration->globalFuelCorrection;
|
||||
ENGINE(fuelMs) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX) * engineConfiguration->globalFuelCorrection;
|
||||
engine->m.fuelCalcTime = GET_TIMESTAMP() - engine->m.beforeFuelCalc;
|
||||
|
||||
}
|
||||
|
@ -393,9 +393,9 @@ void StartupFuelPumping::setPumpsCounter(int newValue) {
|
|||
}
|
||||
}
|
||||
|
||||
void StartupFuelPumping::update(DECLARE_ENGINE_PARAMETER_F) {
|
||||
if (engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F) == 0) {
|
||||
bool isTpsAbove50 = getTPS(PASS_ENGINE_PARAMETER_F) >= 50;
|
||||
void StartupFuelPumping::update(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE) == 0) {
|
||||
bool isTpsAbove50 = getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) >= 50;
|
||||
|
||||
if (this->isTpsAbove50 != isTpsAbove50) {
|
||||
setPumpsCounter(pumpsCounter + 1);
|
||||
|
|
|
@ -150,7 +150,7 @@ int getGlobalConfigurationVersion(void) {
|
|||
* this is the top-level method which should be called in case of any changes to engine configuration
|
||||
* online tuning of most values in the maps does not count as configuration change, but 'Burn' command does
|
||||
*/
|
||||
void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
globalConfigurationVersion++;
|
||||
/**
|
||||
* All these callbacks could be implemented as listeners, but these days I am saving RAM
|
||||
|
@ -168,7 +168,7 @@ void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* @brief Sets the same dwell time across the whole getRpm() range
|
||||
*/
|
||||
void setConstantDwell(floatms_t dwellMs DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setConstantDwell(floatms_t dwellMs DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
for (int i = 0; i < DWELL_CURVE_SIZE; i++) {
|
||||
engineConfiguration->sparkDwellRpmBins[i] = 1000 * i;
|
||||
engineConfiguration->sparkDwellValues[i] = dwellMs;
|
||||
|
@ -191,19 +191,19 @@ void setMap(fuel_table_t table, float value) {
|
|||
}
|
||||
}
|
||||
|
||||
static void setWholeVEMap(float value DECLARE_ENGINE_PARAMETER_S) {
|
||||
static void setWholeVEMap(float value DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setMap(config->veTable, value);
|
||||
}
|
||||
|
||||
void setWholeFuelMap(float value DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setWholeFuelMap(float value DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setMap(config->fuelTable, value);
|
||||
}
|
||||
|
||||
void setWholeIgnitionIatCorr(float value DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setWholeIgnitionIatCorr(float value DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setMap(config->ignitionIatCorrTable, value);
|
||||
}
|
||||
|
||||
void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setTableBin2(config->injPhaseLoadBins, FUEL_LOAD_COUNT, minValue, maxValue, 1);
|
||||
setTableBin2(config->veLoadBins, FUEL_LOAD_COUNT, minValue, maxValue, 1);
|
||||
setTableBin2(config->afrLoadBins, FUEL_LOAD_COUNT, minValue, maxValue, 1);
|
||||
|
@ -217,14 +217,14 @@ void setTimingMap(ignition_table_t map, float value) {
|
|||
}
|
||||
}
|
||||
|
||||
void setWholeIatCorrTimingTable(float value DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setWholeIatCorrTimingTable(float value DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setTimingMap(config->ignitionIatCorrTable, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* See also crankingTimingAngle
|
||||
*/
|
||||
void setWholeTimingTable(angle_t value DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setWholeTimingTable(angle_t value DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setTimingMap(config->ignitionTable, value);
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ void prepareVoidConfiguration(engine_configuration_s *activeConfiguration) {
|
|||
boardConfiguration->ignitionPinMode = OM_DEFAULT;
|
||||
}
|
||||
|
||||
void setDefaultBasePins(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setDefaultBasePins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engineConfiguration->fatalErrorPin = GPIOD_14;
|
||||
engineConfiguration->warninigPin = GPIOD_13;
|
||||
engineConfiguration->configResetPin = GPIOB_1;
|
||||
|
@ -337,7 +337,7 @@ void setDefaultBasePins(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
// todo: move injector calibration somewhere else?
|
||||
// todo: add a enum? if we have enough data?
|
||||
static void setBosch02880155868(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setBosch02880155868(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
// http://www.boschdealer.com/specsheets/0280155868cs.jpg
|
||||
engineConfiguration->injector.battLagCorrBins[0] = 6;
|
||||
engineConfiguration->injector.battLagCorr[0] = 3.371;
|
||||
|
@ -364,7 +364,7 @@ static void setBosch02880155868(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->injector.battLagCorr[7] = 0.726;
|
||||
}
|
||||
|
||||
static void setDefaultWarmupIdleCorrection(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setDefaultWarmupIdleCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
initTemperatureCurve(CLT_CURVE_SIZE, config->cltIdleCorrBins, config->cltIdleCorr, PERCENT_MULT);
|
||||
|
||||
float baseIdle = 30;
|
||||
|
@ -383,7 +383,7 @@ static void setDefaultWarmupIdleCorrection(DECLARE_ENGINE_PARAMETER_F) {
|
|||
setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 70, 33.0 / baseIdle * 100);
|
||||
}
|
||||
|
||||
static void setDefaultWarmupFuelEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setDefaultWarmupFuelEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
initTemperatureCurve(CLT_CURVE_SIZE, config->cltFuelCorrBins, config->cltFuelCorr, PERCENT_MULT);
|
||||
|
||||
setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -40, 150);
|
||||
|
@ -400,7 +400,7 @@ static void setDefaultWarmupFuelEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
|||
setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 70, 101);
|
||||
}
|
||||
|
||||
static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setTableBin2(engineConfiguration->crankingTpsCoef, CRANKING_CURVE_SIZE, 1, 1, 1);
|
||||
setTableBin2(engineConfiguration->crankingTpsBins, CRANKING_CURVE_SIZE, 0, 100, 1);
|
||||
|
||||
|
@ -444,7 +444,7 @@ static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
}
|
||||
|
||||
static void setDefaultIdleSpeedTarget(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setDefaultIdleSpeedTarget(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
// todo: set bins
|
||||
setTableValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -30, 1350);
|
||||
setTableValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -20, 1300);
|
||||
|
@ -464,7 +464,7 @@ static void setDefaultIdleSpeedTarget(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
}
|
||||
|
||||
static void setDefaultStepperIdleParameters(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setDefaultStepperIdleParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
boardConfiguration->idle.stepperDirectionPin = GPIOE_10;
|
||||
boardConfiguration->idle.stepperStepPin = GPIOE_12;
|
||||
engineConfiguration->stepperEnablePin = GPIOE_14;
|
||||
|
@ -472,7 +472,7 @@ static void setDefaultStepperIdleParameters(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->idleStepperTotalSteps = 150;
|
||||
}
|
||||
|
||||
static void setDefaultFsioParameters(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setDefaultFsioParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
for (int i = 0; i < AUX_PID_COUNT; i++) {
|
||||
engineConfiguration->auxPidPins[i] = GPIO_UNASSIGNED;
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ static void setDefaultFsioParameters(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
}
|
||||
|
||||
static void setCanDefaults(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void setCanDefaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
boardConfiguration->canDeviceMode = CD_USE_CAN2;
|
||||
boardConfiguration->canTxPin = GPIOB_6;
|
||||
boardConfiguration->canRxPin = GPIOB_12;
|
||||
|
@ -509,7 +509,7 @@ static void setCanDefaults(DECLARE_ENGINE_PARAMETER_F) {
|
|||
* This method should only change the state of the configuration data structure but should NOT change the state of
|
||||
* anything else.
|
||||
*/
|
||||
void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
#if (! EFI_UNIT_TEST) || defined(__DOXYGEN__)
|
||||
memset(&persistentState.persistentConfiguration, 0, sizeof(persistentState.persistentConfiguration));
|
||||
#endif
|
||||
|
@ -520,7 +520,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
boardConfiguration->startConsoleInBinaryMode = true;
|
||||
|
||||
setBosch02880155868(PASS_ENGINE_PARAMETER_F);
|
||||
setBosch02880155868(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->acCutoffLowRpm = 700;
|
||||
engineConfiguration->acCutoffHighRpm = 5000;
|
||||
|
@ -542,19 +542,19 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
setTableBin2(engineConfiguration->cltTimingBins, CLT_TIMING_CURVE_SIZE, -40, 120, 1);
|
||||
setTableBin2(engineConfiguration->cltTimingExtra, CLT_TIMING_CURVE_SIZE, 0, 0, 1);
|
||||
|
||||
setDefaultWarmupIdleCorrection(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultWarmupIdleCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
setDefaultWarmupFuelEnrichment(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultWarmupFuelEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
setConstantDwell(4 PASS_ENGINE_PARAMETER); // 4ms is global default dwell
|
||||
setConstantDwell(4 PASS_ENGINE_PARAMETER_SUFFIX); // 4ms is global default dwell
|
||||
// disable constant_dwell
|
||||
engineConfiguration->useConstantDwellDuringCranking = false;
|
||||
engineConfiguration->ignitionDwellForCrankingMs = 6;
|
||||
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
|
||||
setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
|
||||
setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
|
||||
setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
setTableBin2(engineConfiguration->map.samplingAngleBins, MAP_ANGLE_SIZE, 800, 7000, 1);
|
||||
setTableBin2(engineConfiguration->map.samplingAngle, MAP_ANGLE_SIZE, 100, 130, 1);
|
||||
|
@ -562,15 +562,15 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
setTableBin2(engineConfiguration->map.samplingWindow, MAP_ANGLE_SIZE, 50, 50, 1);
|
||||
|
||||
// set_whole_timing_map 3
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setAfrMap(config->afrTable, 14.7);
|
||||
|
||||
setDefaultVETable(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultVETable(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
setMap(config->injectionPhase, -180);
|
||||
setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT);
|
||||
setFuelTablesLoadBin(10, 160 PASS_ENGINE_PARAMETER);
|
||||
setDefaultIatTimingCorrection(PASS_ENGINE_PARAMETER_F);
|
||||
setFuelTablesLoadBin(10, 160 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
setDefaultIatTimingCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
setTableBin2(engineConfiguration->mapAccelTaperBins, FSIO_TABLE_8, 0, 32, 4);
|
||||
setTableBin2(engineConfiguration->mapAccelTaperMult, FSIO_TABLE_8, 1, 1, 1);
|
||||
|
@ -587,7 +587,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
setTableBin2(config->fsioTable4LoadBins, FSIO_TABLE_8, 20, 120, 10);
|
||||
setRpmTableBin(config->fsioTable4RpmBins, FSIO_TABLE_8);
|
||||
|
||||
initEngineNoiseTable(PASS_ENGINE_PARAMETER_F);
|
||||
initEngineNoiseTable(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
setThermistorConfiguration(&engineConfiguration->clt, 0, 9500, 23.8889, 2100, 48.8889, 1000);
|
||||
engineConfiguration->clt.config.bias_resistor = 1500;
|
||||
|
@ -628,7 +628,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
engineConfiguration->noAccelAfterHardLimitPeriodSecs = 3;
|
||||
|
||||
setDefaultCrankingSettings(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultCrankingSettings(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->warmupTargetAfrBins[0] = -12;
|
||||
engineConfiguration->warmupTargetAfr[0] = 12.3;
|
||||
|
@ -639,7 +639,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->warmupTargetAfrBins[3] = 60;
|
||||
engineConfiguration->warmupTargetAfr[3] = 14.5;
|
||||
|
||||
setDefaultIdleSpeedTarget(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultIdleSpeedTarget(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
engineConfiguration->fuelClosedLoopCorrectionEnabled = false;
|
||||
|
@ -723,7 +723,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
engineConfiguration->cylinderBore = 87.5;
|
||||
|
||||
setEgoSensor(ES_14Point7_Free PASS_ENGINE_PARAMETER);
|
||||
setEgoSensor(ES_14Point7_Free PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
engineConfiguration->globalFuelCorrection = 1;
|
||||
|
||||
|
@ -751,7 +751,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->useSerialPort = true;
|
||||
boardConfiguration->useStepperIdle = false;
|
||||
|
||||
setDefaultStepperIdleParameters(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultStepperIdleParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
|
@ -796,13 +796,13 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->max31855_cs[i] = GPIO_UNASSIGNED;
|
||||
}
|
||||
|
||||
setDefaultFsioParameters(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultFsioParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->alternatorPwmFrequency = 300;
|
||||
|
||||
engineConfiguration->communicationPin = GPIOD_15; // blue LED on discovery
|
||||
engineConfiguration->runningPin = GPIOD_12; // greeb LED on discovery
|
||||
setDefaultBasePins(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultBasePins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
engineConfiguration->binarySerialTxPin = GPIOC_10;
|
||||
engineConfiguration->binarySerialRxPin = GPIOC_11;
|
||||
engineConfiguration->consoleSerialTxPin = GPIOC_10;
|
||||
|
@ -852,7 +852,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
boardConfiguration->boardTestModeJumperPin = GPIOB_0;
|
||||
|
||||
setCanDefaults(PASS_ENGINE_PARAMETER_F);
|
||||
setCanDefaults(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
// set this to SPI_DEVICE_3 to enable stimulation
|
||||
|
@ -910,12 +910,12 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_S) {
|
||||
void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
enginePins.reset(); // that's mostly important for functional tests
|
||||
/**
|
||||
* Let's apply global defaults first
|
||||
*/
|
||||
setDefaultConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setDefaultConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
#if EFI_SIMULATOR || defined(__DOXYGEN__)
|
||||
engineConfiguration->directSelfStimulation = true;
|
||||
#endif /* */
|
||||
|
@ -926,34 +926,34 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
|||
*/
|
||||
switch (engineType) {
|
||||
case CUSTOM_ENGINE:
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case ACURA_RSX:
|
||||
setAcuraRSX(engineConfiguration);
|
||||
break;
|
||||
#if EFI_SUPPORT_DODGE_NEON || defined(__DOXYGEN__)
|
||||
case DODGE_NEON_1995:
|
||||
setDodgeNeon1995EngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setDodgeNeon1995EngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case DODGE_NEON_2003_CAM:
|
||||
setDodgeNeonNGCEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setDodgeNeonNGCEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case DODGE_NEON_2003_CRANK:
|
||||
setDodgeNeonNGCEngineConfigurationCrankBased(PASS_ENGINE_PARAMETER_F);
|
||||
setDodgeNeonNGCEngineConfigurationCrankBased(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case LADA_KALINA:
|
||||
setLadaKalina(PASS_ENGINE_PARAMETER_F);
|
||||
setLadaKalina(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
|
||||
#endif /* EFI_SUPPORT_DODGE_NEON */
|
||||
#if EFI_SUPPORT_FORD_ASPIRE || defined(__DOXYGEN__)
|
||||
case FORD_ASPIRE_1996:
|
||||
setFordAspireEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setFordAspireEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#endif /* EFI_SUPPORT_FORD_ASPIRE */
|
||||
#if EFI_SUPPORT_FORD_FIESTA || defined(__DOXYGEN__)
|
||||
case FORD_FIESTA:
|
||||
setFordFiestaDefaultEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setFordFiestaDefaultEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#endif /* EFI_SUPPORT_FORD_FIESTA */
|
||||
#if EFI_SUPPORT_NISSAN_PRIMERA || defined(__DOXYGEN__)
|
||||
|
@ -962,109 +962,109 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
|||
break;
|
||||
#endif
|
||||
case HONDA_ACCORD_CD:
|
||||
setHondaAccordConfigurationThreeWires(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaAccordConfigurationThreeWires(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case ZIL_130:
|
||||
setZil130(PASS_ENGINE_PARAMETER_F);
|
||||
setZil130(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MIATA_NA_1_6:
|
||||
setMiataNA_1_6_Configuration(PASS_ENGINE_PARAMETER_F);
|
||||
setMiataNA_1_6_Configuration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case TEST_CIVIC_4_0_BOTH:
|
||||
setHondaCivic4_0_both(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaCivic4_0_both(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case TEST_CIVIC_4_0_RISE:
|
||||
setHondaCivic4_0_rise(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaCivic4_0_rise(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case HONDA_ACCORD_CD_TWO_WIRES:
|
||||
setHondaAccordConfiguration1_24(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaAccordConfiguration1_24(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case HONDA_ACCORD_1_24_SHIFTED:
|
||||
setHondaAccordConfiguration1_24_shifted(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaAccordConfiguration1_24_shifted(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case FRANKENSO_QA_ENGINE:
|
||||
setFrankensoBoardTestConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setFrankensoBoardTestConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case HONDA_ACCORD_CD_DIP:
|
||||
setHondaAccordConfigurationDip(PASS_ENGINE_PARAMETER_F);
|
||||
setHondaAccordConfigurationDip(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MITSU_4G93:
|
||||
setMitsubishiConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setMitsubishiConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#if EFI_SUPPORT_1995_FORD_INLINE_6 || defined(__DOXYGEN__)
|
||||
case FORD_INLINE_6_1995:
|
||||
setFordInline6(PASS_ENGINE_PARAMETER_F);
|
||||
setFordInline6(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#endif /* EFI_SUPPORT_1995_FORD_INLINE_6 */
|
||||
case GY6_139QMB:
|
||||
setGy6139qmbDefaultEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setGy6139qmbDefaultEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case HONDA_600:
|
||||
setHonda600(PASS_ENGINE_PARAMETER_F);
|
||||
setHonda600(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MAZDA_MIATA_NB1:
|
||||
setMazdaMiataNb1EngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setMazdaMiataNb1EngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MAZDA_323:
|
||||
setMazda323EngineConfiguration(engineConfiguration);
|
||||
break;
|
||||
case MAZDA_626:
|
||||
setMazda626EngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setMazda626EngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case SATURN_ION_2004:
|
||||
setSaturnIonEngineConfiguration(engineConfiguration);
|
||||
break;
|
||||
case SUZUKI_VITARA:
|
||||
setSuzukiVitara(PASS_ENGINE_PARAMETER_F);
|
||||
setSuzukiVitara(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MINI_COOPER_R50:
|
||||
setMiniCooperR50(engineConfiguration);
|
||||
break;
|
||||
case FORD_ESCORT_GT:
|
||||
setFordEscortGt(PASS_ENGINE_PARAMETER_F);
|
||||
setFordEscortGt(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MIATA_1990:
|
||||
setMiata1990(PASS_ENGINE_PARAMETER_F);
|
||||
setMiata1990(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MIATA_1994_DEVIATOR:
|
||||
setMiata1994_d(PASS_ENGINE_PARAMETER_F);
|
||||
setMiata1994_d(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MIATA_1994_SPAGS:
|
||||
setMiata1994_s(PASS_ENGINE_PARAMETER_F);
|
||||
setMiata1994_s(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MIATA_1996:
|
||||
setMiata1996(PASS_ENGINE_PARAMETER_F);
|
||||
setMiata1996(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case CITROEN_TU3JP:
|
||||
setCitroenBerlingoTU3JPConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setCitroenBerlingoTU3JPConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case ROVER_V8:
|
||||
setRoverv8(PASS_ENGINE_PARAMETER_F);
|
||||
setRoverv8(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case SUBARU_2003_WRX:
|
||||
setSubaru2003Wrx(PASS_ENGINE_PARAMETER_F);
|
||||
setSubaru2003Wrx(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case BMW_E34:
|
||||
setBmwE34(PASS_ENGINE_PARAMETER_F);
|
||||
setBmwE34(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case GM_2_2:
|
||||
setGm2_2(PASS_ENGINE_PARAMETER_F);
|
||||
setGm2_2(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case DODGE_RAM:
|
||||
setDodgeRam1996(PASS_ENGINE_PARAMETER_F);
|
||||
setDodgeRam1996(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case DODGE_STRATUS:
|
||||
setDodgeStratus(PASS_ENGINE_PARAMETER_F);
|
||||
setDodgeStratus(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case VW_ABA:
|
||||
setVwAba(PASS_ENGINE_PARAMETER_F);
|
||||
setVwAba(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#if EFI_UNIT_TEST
|
||||
case TEST_ISSUE_366_BOTH:
|
||||
setTestEngineIssue366both(PASS_ENGINE_PARAMETER_F);
|
||||
setTestEngineIssue366both(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case TEST_ISSUE_366_RISE:
|
||||
setTestEngineIssue366rise(PASS_ENGINE_PARAMETER_F);
|
||||
setTestEngineIssue366rise(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#else
|
||||
case TEST_ISSUE_366_BOTH:
|
||||
|
@ -1072,46 +1072,46 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
|||
#endif
|
||||
|
||||
case TEST_ENGINE:
|
||||
setTestEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setTestEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MAZDA_MIATA_2003:
|
||||
setMazdaMiata2003EngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setMazdaMiata2003EngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MAZDA_MIATA_2003_BETTER:
|
||||
setMazdaMiata2003EngineConfigurationNewBoard(PASS_ENGINE_PARAMETER_F);
|
||||
setMazdaMiata2003EngineConfigurationNewBoard(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case PROMETHEUS_DEFAULTS:
|
||||
setPrometheusDefaults(PASS_ENGINE_PARAMETER_F);
|
||||
setPrometheusDefaults(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case TEST_ENGINE_VVT:
|
||||
setTestVVTEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setTestVVTEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case SACHS:
|
||||
setSachs(PASS_ENGINE_PARAMETER_F);
|
||||
setSachs(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case DAIHATSU:
|
||||
setDaihatsu(PASS_ENGINE_PARAMETER_F);
|
||||
setDaihatsu(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case CAMARO_4:
|
||||
setCamaro4(PASS_ENGINE_PARAMETER_F);
|
||||
setCamaro4(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case CHEVY_C20_1973:
|
||||
set1973c20(PASS_ENGINE_PARAMETER_F);
|
||||
set1973c20(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case TOYOTA_2JZ_GTE_VVTi:
|
||||
setToyota_2jz_vics(PASS_ENGINE_PARAMETER_F);
|
||||
setToyota_2jz_vics(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case TOYOTA_JZS147:
|
||||
setToyota_jzs147EngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setToyota_jzs147EngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case GEO_STORM:
|
||||
setGeoStormConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
setGeoStormConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
|
||||
default:
|
||||
warning(CUSTOM_UNEXPECTED_ENGINE_TYPE, "Unexpected engine type: %d", engineType);
|
||||
}
|
||||
applyNonPersistentConfiguration(logger PASS_ENGINE_PARAMETER);
|
||||
applyNonPersistentConfiguration(logger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// todo: eliminate triggerShape.operationMode?
|
||||
if (engineConfiguration->operationMode != TRIGGER_SHAPE(getOperationMode())) {
|
||||
warning(CUSTOM_ERR_OP_MODE, "operationMode %d/trigger mismatch %d",
|
||||
|
@ -1124,16 +1124,16 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
|||
#endif
|
||||
}
|
||||
|
||||
void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_S) {
|
||||
void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 256, "apply c");
|
||||
scheduleMsg(logger, "applyNonPersistentConfiguration()");
|
||||
#endif
|
||||
|
||||
assertEngineReference(PASS_ENGINE_PARAMETER_F);
|
||||
assertEngineReference(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
||||
engine->triggerCentral.triggerShape.initializeTriggerShape(logger PASS_ENGINE_PARAMETER);
|
||||
engine->triggerCentral.triggerShape.initializeTriggerShape(logger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#endif
|
||||
if (engine->triggerCentral.triggerShape.getSize() == 0) {
|
||||
firmwareError(CUSTOM_ERR_TRIGGER_ZERO, "triggerShape size is zero");
|
||||
|
@ -1141,16 +1141,16 @@ void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_S
|
|||
}
|
||||
engine->engineCycleEventCount = engine->triggerCentral.triggerShape.getLength();
|
||||
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||
applyFsioConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
applyFsioConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
||||
|
||||
void prepareShapes(DECLARE_ENGINE_PARAMETER_F) {
|
||||
prepareOutputSignals(PASS_ENGINE_PARAMETER_F);
|
||||
void prepareShapes(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
prepareOutputSignals(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engine->injectionEvents.addFuelEvents(PASS_ENGINE_PARAMETER_F);
|
||||
engine->injectionEvents.addFuelEvents(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -50,7 +50,7 @@ extern baroCorr_Map3D_t baroCorrMap;
|
|||
/**
|
||||
* @return total duration of fuel injection per engine cycle, in milliseconds
|
||||
*/
|
||||
float getRealMafFuel(float airSpeed, int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
float getRealMafFuel(float airSpeed, int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (rpm == 0)
|
||||
return 0;
|
||||
// duration of engine cycle, in hours
|
||||
|
@ -71,18 +71,18 @@ float getRealMafFuel(float airSpeed, int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
}
|
||||
|
||||
// todo: rename this method since it's now base+TPSaccel
|
||||
floatms_t getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t tpsAccelEnrich = ENGINE(tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_F));
|
||||
floatms_t getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
floatms_t tpsAccelEnrich = ENGINE(tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
efiAssert(!cisnan(tpsAccelEnrich), "NaN tpsAccelEnrich", 0);
|
||||
ENGINE(engineState.tpsAccelEnrich) = tpsAccelEnrich;
|
||||
|
||||
floatms_t baseFuel;
|
||||
if (CONFIG(fuelAlgorithm) == LM_SPEED_DENSITY) {
|
||||
baseFuel = getSpeedDensityFuel(PASS_ENGINE_PARAMETER_F);
|
||||
baseFuel = getSpeedDensityFuel(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
efiAssert(!cisnan(baseFuel), "NaN sd baseFuel", 0);
|
||||
} else if (engineConfiguration->fuelAlgorithm == LM_REAL_MAF) {
|
||||
float maf = getRealMaf(PASS_ENGINE_PARAMETER_F) + engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_F);
|
||||
baseFuel = getRealMafFuel(maf, rpm PASS_ENGINE_PARAMETER);
|
||||
float maf = getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE) + engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
baseFuel = getRealMafFuel(maf, rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
efiAssert(!cisnan(baseFuel), "NaN rm baseFuel", 0);
|
||||
} else {
|
||||
baseFuel = engine->engineState.baseTableFuel;
|
||||
|
@ -93,8 +93,8 @@ floatms_t getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
return tpsAccelEnrich + baseFuel;
|
||||
}
|
||||
|
||||
angle_t getinjectionOffset(float rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F);
|
||||
angle_t getinjectionOffset(float rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
angle_t result = fuelPhaseMap.getValue(rpm, engineLoad) + CONFIG(extraInjectionOffset);
|
||||
fixAngle(result, "inj offset");
|
||||
return result;
|
||||
|
@ -104,7 +104,7 @@ angle_t getinjectionOffset(float rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
* Number of injections into each cylinder per engine cycle
|
||||
* @see getNumberOfSparks
|
||||
*/
|
||||
int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_S) {
|
||||
int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
switch (mode) {
|
||||
case IM_SIMULTANEOUS:
|
||||
return engineConfiguration->specs.cylindersCount;
|
||||
|
@ -121,31 +121,31 @@ int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_S) {
|
|||
/**
|
||||
* @see getCoilDutyCycle
|
||||
*/
|
||||
percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t totalPerCycle = getInjectionDuration(rpm PASS_ENGINE_PARAMETER) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER);
|
||||
floatms_t engineCycleDuration = getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER);
|
||||
percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
floatms_t totalPerCycle = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
floatms_t engineCycleDuration = getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
return 100 * totalPerCycle / engineCycleDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns Length of each individual fuel injection, in milliseconds
|
||||
*/
|
||||
floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
float theoreticalInjectionLength;
|
||||
bool isCranking = isCrankingR(rpm);
|
||||
int numberOfCylinders = getNumberOfInjections(isCranking ?
|
||||
engineConfiguration->crankingInjectionMode :
|
||||
engineConfiguration->injectionMode PASS_ENGINE_PARAMETER);
|
||||
engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (numberOfCylinders == 0) {
|
||||
warning(CUSTOM_CONFIG_NOT_READY, "config not ready");
|
||||
return 0; // we can end up here during configuration reset
|
||||
}
|
||||
if (isCranking) {
|
||||
theoreticalInjectionLength = getCrankingFuel(PASS_ENGINE_PARAMETER_F) / numberOfCylinders;
|
||||
theoreticalInjectionLength = getCrankingFuel(PASS_ENGINE_PARAMETER_SIGNATURE) / numberOfCylinders;
|
||||
efiAssert(!cisnan(theoreticalInjectionLength), "NaN cranking theoreticalInjectionLength", 0);
|
||||
} else {
|
||||
floatms_t baseFuel = getBaseFuel(rpm PASS_ENGINE_PARAMETER);
|
||||
floatms_t fuelPerCycle = getRunningFuel(baseFuel PASS_ENGINE_PARAMETER);
|
||||
floatms_t baseFuel = getBaseFuel(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
floatms_t fuelPerCycle = getRunningFuel(baseFuel PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
theoreticalInjectionLength = fuelPerCycle / numberOfCylinders;
|
||||
efiAssert(!cisnan(theoreticalInjectionLength), "NaN fuelPerCycle", 0);
|
||||
#if EFI_PRINTF_FUEL_DETAILS || defined(__DOXYGEN__)
|
||||
|
@ -161,7 +161,7 @@ floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
return theoreticalInjectionLength + injectorLag;
|
||||
}
|
||||
|
||||
floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
float iatCorrection = ENGINE(engineState.iatFuelCorrection);
|
||||
float cltCorrection = ENGINE(engineState.cltFuelCorrection);
|
||||
efiAssert(!cisnan(iatCorrection), "NaN iatCorrection", 0);
|
||||
|
@ -179,7 +179,7 @@ floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_S) {
|
|||
* @param vBatt Battery voltage.
|
||||
* @return Time in ms for injection opening time based on current battery voltage
|
||||
*/
|
||||
floatms_t getInjectorLag(float vBatt DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t getInjectorLag(float vBatt DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (cisnan(vBatt)) {
|
||||
warning(OBD_System_Voltage_Malfunction, "vBatt=%f", vBatt);
|
||||
return 0;
|
||||
|
@ -194,7 +194,7 @@ floatms_t getInjectorLag(float vBatt DECLARE_ENGINE_PARAMETER_S) {
|
|||
* @note this method has nothing to do with fuel map VALUES - it's job
|
||||
* is to prepare the fuel map data structure for 3d interpolation
|
||||
*/
|
||||
void prepareFuelMap(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void prepareFuelMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
fuelMap.init(config->fuelTable, config->fuelLoadBins, config->fuelRpmBins);
|
||||
fuelPhaseMap.init(config->injectionPhase, config->injPhaseLoadBins, config->injPhaseRpmBins);
|
||||
}
|
||||
|
@ -202,19 +202,19 @@ void prepareFuelMap(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* @brief Engine warm-up fuel correction.
|
||||
*/
|
||||
float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (cisnan(engine->sensors.clt))
|
||||
return 1; // this error should be already reported somewhere else, let's just handle it
|
||||
return interpolate2d(engine->sensors.clt, config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE) / PERCENT_MULT;
|
||||
}
|
||||
|
||||
angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_F) {
|
||||
angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (cisnan(engine->sensors.clt))
|
||||
return 0; // this error should be already reported somewhere else, let's just handle it
|
||||
return interpolate2d(engine->sensors.clt, engineConfiguration->cltTimingBins, engineConfiguration->cltTimingExtra, CLT_TIMING_CURVE_SIZE);
|
||||
}
|
||||
|
||||
float getIatFuelCorrection(float iat DECLARE_ENGINE_PARAMETER_S) {
|
||||
float getIatFuelCorrection(float iat DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (cisnan(iat))
|
||||
return 1; // this error should be already reported somewhere else, let's just handle it
|
||||
return interpolate2d(iat, config->iatFuelCorrBins, config->iatFuelCorr, IAT_CURVE_SIZE);
|
||||
|
@ -237,9 +237,9 @@ floatms_t getBaseTableFuel(int rpm, float engineLoad) {
|
|||
return result;
|
||||
}
|
||||
|
||||
float getBaroCorrection(DECLARE_ENGINE_PARAMETER_F) {
|
||||
if (hasBaroSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
return baroCorrMap.getValue(getRpmE(engine), getBaroPressure(PASS_ENGINE_PARAMETER_F));
|
||||
float getBaroCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (hasBaroSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
return baroCorrMap.getValue(getRpmE(engine), getBaroPressure(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
@ -249,14 +249,14 @@ float getBaroCorrection(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* @return Duration of fuel injection while craning
|
||||
*/
|
||||
floatms_t getCrankingFuel(DECLARE_ENGINE_PARAMETER_F) {
|
||||
return getCrankingFuel3(getCoolantTemperature(PASS_ENGINE_PARAMETER_F),
|
||||
engine->rpmCalculator.getRevolutionCounterSinceStart() PASS_ENGINE_PARAMETER);
|
||||
floatms_t getCrankingFuel(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return getCrankingFuel3(getCoolantTemperature(PASS_ENGINE_PARAMETER_SIGNATURE),
|
||||
engine->rpmCalculator.getRevolutionCounterSinceStart() PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
#endif
|
||||
|
||||
floatms_t getCrankingFuel3(float coolantTemperature,
|
||||
uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_S) {
|
||||
uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
// these magic constants are in Celsius
|
||||
float baseCrankingFuel = engineConfiguration->cranking.baseFuel;
|
||||
if (cisnan(coolantTemperature)) // todo: move this check down, below duration correction?
|
||||
|
@ -267,7 +267,7 @@ floatms_t getCrankingFuel3(float coolantTemperature,
|
|||
float coolantTempCoef = interpolate2d(coolantTemperature, config->crankingFuelBins,
|
||||
config->crankingFuelCoef, CRANKING_CURVE_SIZE);
|
||||
|
||||
float tpsCoef = interpolate2d(getTPS(PASS_ENGINE_PARAMETER_F), engineConfiguration->crankingTpsBins,
|
||||
float tpsCoef = interpolate2d(getTPS(PASS_ENGINE_PARAMETER_SIGNATURE), engineConfiguration->crankingTpsBins,
|
||||
engineConfiguration->crankingTpsCoef, CRANKING_CURVE_SIZE);
|
||||
|
||||
return baseCrankingFuel * durationCoef * coolantTempCoef * tpsCoef;
|
||||
|
|
|
@ -38,7 +38,7 @@ IdleValveState::IdleValveState() {
|
|||
targetRpmRangeLeft = targetRpmRangeRight = 0;
|
||||
}
|
||||
|
||||
void IdleValveState::init(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void IdleValveState::init(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setTargetRpm(engineConfiguration->targetIdleRpm);
|
||||
}
|
||||
|
||||
|
@ -63,19 +63,19 @@ static percent_t setNewValue(IdleValveState *idle, int currentRpm, efitimems_t n
|
|||
return newValue;
|
||||
}
|
||||
|
||||
bool isTpsLockout(DECLARE_ENGINE_PARAMETER_F) {
|
||||
bool isTpsLockout(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
// if we have TPS sensor, then use it
|
||||
if (hasTpsSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
return getTPS(PASS_ENGINE_PARAMETER_F) > TPS_IDLE_LOCKOUT;
|
||||
if (hasTpsSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
return getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) > TPS_IDLE_LOCKOUT;
|
||||
}
|
||||
// TODO: if no TPS sensor then idle switch is our
|
||||
return true;
|
||||
}
|
||||
|
||||
static percent_t changeValue(IdleValveState *idle, int currentRpm, int now, const char * msg, percent_t delta DECLARE_ENGINE_PARAMETER_S) {
|
||||
if (isTpsLockout(PASS_ENGINE_PARAMETER_F)) {
|
||||
static percent_t changeValue(IdleValveState *idle, int currentRpm, int now, const char * msg, percent_t delta DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (isTpsLockout(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
// We are not supposed to be in idle mode. Don't touch anything
|
||||
idleDebug("TPS Lockout, TPS=", getTPS(PASS_ENGINE_PARAMETER_F));
|
||||
idleDebug("TPS Lockout, TPS=", getTPS(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
return idle->value;
|
||||
}
|
||||
percent_t newValue = idle->value + delta;
|
||||
|
@ -85,7 +85,7 @@ static percent_t changeValue(IdleValveState *idle, int currentRpm, int now, cons
|
|||
/**
|
||||
* now - current time in milliseconds
|
||||
*/
|
||||
percent_t IdleValveState::getIdle(int currentRpm, efitimems_t now DECLARE_ENGINE_PARAMETER_S) {
|
||||
percent_t IdleValveState::getIdle(int currentRpm, efitimems_t now DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (currentRpm == 0 || isCranking()) {
|
||||
// todo: why hard-coded value during cranking
|
||||
return setNewValue(this, currentRpm, now, "cranking value: ", DEFAULT_IDLE_DUTY);
|
||||
|
@ -108,14 +108,14 @@ percent_t IdleValveState::getIdle(int currentRpm, efitimems_t now DECLARE_ENGINE
|
|||
}
|
||||
|
||||
if (currentRpm >= targetRpmRangeRight + 100)
|
||||
return changeValue(this, currentRpm, now, "idle control: rpm is too high: ", -IDLE_DECREASE_STEP PASS_ENGINE_PARAMETER);
|
||||
return changeValue(this, currentRpm, now, "idle control: rpm is too high: ", -IDLE_DECREASE_STEP PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
if (currentRpm >= targetRpmRangeRight)
|
||||
return changeValue(this, currentRpm, now, "idle control: rpm is a bit too high: ", -IDLE_DECREASE_SMALL_STEP PASS_ENGINE_PARAMETER);
|
||||
return changeValue(this, currentRpm, now, "idle control: rpm is a bit too high: ", -IDLE_DECREASE_SMALL_STEP PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// we are here if RPM is low, let's see how low
|
||||
if (currentRpm < targetRpmRangeLeft - 100) {
|
||||
return changeValue(this, currentRpm, now, "idle control: RPMs are low: ", IDLE_INCREASE_STEP PASS_ENGINE_PARAMETER);
|
||||
return changeValue(this, currentRpm, now, "idle control: RPMs are low: ", IDLE_INCREASE_STEP PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
return changeValue(this, currentRpm, now, "idle control: RPMs are a bit low: ", IDLE_INCREASE_SMALL_STEP PASS_ENGINE_PARAMETER);
|
||||
return changeValue(this, currentRpm, now, "idle control: RPMs are a bit low: ", IDLE_INCREASE_SMALL_STEP PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
|
|
@ -80,15 +80,15 @@ float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action) {
|
|||
case LE_METHOD_FAN:
|
||||
return enginePins.fanRelay.getLogicValue();
|
||||
case LE_METHOD_AC_TOGGLE:
|
||||
return getAcToggle(PASS_ENGINE_PARAMETER_F);
|
||||
return getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
case LE_METHOD_COOLANT:
|
||||
return getCoolantTemperature(PASS_ENGINE_PARAMETER_F);
|
||||
return getCoolantTemperature(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
case LE_METHOD_INTAKE_AIR:
|
||||
return getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F);
|
||||
return getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
case LE_METHOD_RPM:
|
||||
return engine->rpmCalculator.getRpm();
|
||||
case LE_METHOD_MAF:
|
||||
return getMaf(PASS_ENGINE_PARAMETER_F);
|
||||
return getMaf(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
case LE_METHOD_MAP:
|
||||
return getMap();
|
||||
case LE_METHOD_INTAKE_VVT:
|
||||
|
@ -101,7 +101,7 @@ float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action) {
|
|||
case LE_METHOD_FAN_ON_SETTING:
|
||||
return engineConfiguration->fanOnTemperature;
|
||||
case LE_METHOD_VBATT:
|
||||
return getVBatt(PASS_ENGINE_PARAMETER_F);
|
||||
return getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
default:
|
||||
warning(CUSTOM_FSIO_UNEXPECTED, "FSIO unexpected %d", action);
|
||||
return NAN;
|
||||
|
@ -170,7 +170,7 @@ static void setFsioOutputPin(const char *indexStr, const char *pinName) {
|
|||
/**
|
||||
* index is between zero and LE_COMMAND_LENGTH-1
|
||||
*/
|
||||
void setFsioExt(int index, brain_pin_e pin, const char * exp, int freq DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setFsioExt(int index, brain_pin_e pin, const char * exp, int freq DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
boardConfiguration->fsioPins[index] = pin;
|
||||
int len = strlen(exp);
|
||||
if (len >= LE_COMMAND_LENGTH) {
|
||||
|
@ -180,11 +180,11 @@ void setFsioExt(int index, brain_pin_e pin, const char * exp, int freq DECLARE_E
|
|||
boardConfiguration->fsioFrequency[index] = freq;
|
||||
}
|
||||
|
||||
void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_ENGINE_PARAMETER_S) {
|
||||
setFsioExt(index, pin, exp, NO_PWM PASS_ENGINE_PARAMETER);
|
||||
void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setFsioExt(index, pin, exp, NO_PWM PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
userPool.reset();
|
||||
for (int i = 0; i < LE_COMMAND_COUNT; i++) {
|
||||
brain_pin_e brainPin = boardConfiguration->fsioPins[i];
|
||||
|
@ -460,7 +460,7 @@ static void setFsioExpression(const char *indexStr, const char *quotedLine, Engi
|
|||
scheduleMsg(logger, "setting user out #%d to [%s]", index + 1, l);
|
||||
strcpy(engine->config->le_formulas[index], l);
|
||||
// this would apply the changes
|
||||
applyFsioConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
applyFsioConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
showFsioInfo();
|
||||
#endif
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ static void rpnEval(char *line, Engine *engine) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
logger = sharedLogger;
|
||||
#endif
|
||||
|
|
|
@ -169,7 +169,7 @@ static void cylinderCleanupControl(Engine *engine) {
|
|||
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
||||
bool newValue;
|
||||
if (engineConfiguration->isCylinderCleanupEnabled) {
|
||||
newValue = !engine->rpmCalculator.isRunning(PASS_ENGINE_PARAMETER_F) && getTPS(PASS_ENGINE_PARAMETER_F) > CLEANUP_MODE_TPS;
|
||||
newValue = !engine->rpmCalculator.isRunning(PASS_ENGINE_PARAMETER_SIGNATURE) && getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) > CLEANUP_MODE_TPS;
|
||||
} else {
|
||||
newValue = false;
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ static void scheduleNextSlowInvocation(void) {
|
|||
chVTSetAny(&periodicSlowTimer, MS2ST(periodMs), (vtfunc_t) &periodicSlowCallback, engine);
|
||||
}
|
||||
|
||||
static void periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
engine->periodicFastCallback();
|
||||
|
||||
chVTSetAny(&periodicFastTimer, MS2ST(20), (vtfunc_t) &periodicFastCallback, engine);
|
||||
|
@ -241,9 +241,9 @@ static void periodicSlowCallback(Engine *engine) {
|
|||
scheduleNextSlowInvocation();
|
||||
}
|
||||
|
||||
void initPeriodicEvents(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void initPeriodicEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
scheduleNextSlowInvocation();
|
||||
periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
char * getPinNameByAdcChannel(const char *msg, adc_channel_e hwChannel, char *buffer) {
|
||||
|
@ -314,10 +314,10 @@ static void printAnalogInfo(void) {
|
|||
}
|
||||
|
||||
printAnalogChannelInfo("AFR", engineConfiguration->afr.hwChannel);
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
printAnalogChannelInfo("MAP", engineConfiguration->map.sensor.hwChannel);
|
||||
}
|
||||
if (hasBaroSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (hasBaroSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
printAnalogChannelInfo("BARO", engineConfiguration->baroSensor.hwChannel);
|
||||
}
|
||||
if (engineConfiguration->externalKnockSenseAdc != EFI_ADC_NONE) {
|
||||
|
@ -370,7 +370,7 @@ static void setBit(const char *offsetStr, const char *bitStr, const char *valueS
|
|||
* this response is part of dev console API
|
||||
*/
|
||||
scheduleMsg(&logger, "bit @%d/%d is %d", offset, bit, value);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void setShort(const int offset, const int value) {
|
||||
|
@ -379,7 +379,7 @@ static void setShort(const int offset, const int value) {
|
|||
uint16_t *ptr = (uint16_t *) (&((char *) engineConfiguration)[offset]);
|
||||
*ptr = (uint16_t) value;
|
||||
getShort(offset);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void getBit(int offset, int bit) {
|
||||
|
@ -410,7 +410,7 @@ static void setInt(const int offset, const int value) {
|
|||
int *ptr = (int *) (&((char *) engineConfiguration)[offset]);
|
||||
*ptr = value;
|
||||
getInt(offset);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void getFloat(int offset) {
|
||||
|
@ -509,7 +509,7 @@ static void getKnockInfo(void) {
|
|||
}
|
||||
|
||||
// this method is used by real firmware and simulator
|
||||
void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
initConfigActions();
|
||||
initMockVoltage();
|
||||
|
||||
|
@ -535,17 +535,17 @@ void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S
|
|||
if (hasFirmwareError()) {
|
||||
return;
|
||||
}
|
||||
initSensors(sharedLogger PASS_ENGINE_PARAMETER_F);
|
||||
initSensors(sharedLogger PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||
initFsioImpl(sharedLogger PASS_ENGINE_PARAMETER);
|
||||
initFsioImpl(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#endif
|
||||
|
||||
initAccelEnrichment(sharedLogger);
|
||||
|
||||
}
|
||||
|
||||
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
addConsoleAction("analoginfo", printAnalogInfo);
|
||||
commonInitEngineController(sharedLogger);
|
||||
|
||||
|
@ -577,7 +577,7 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
// multiple issues with this initMapAdjusterThread();
|
||||
// periodic events need to be initialized after fuel&spark pins to avoid a warning
|
||||
initPeriodicEvents(PASS_ENGINE_PARAMETER_F);
|
||||
initPeriodicEvents(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
if (hasFirmwareError()) {
|
||||
return;
|
||||
|
@ -590,7 +590,7 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
|||
* This has to go after 'initInjectorCentral' and 'initInjectorCentral' in order to
|
||||
* properly detect un-assigned output pins
|
||||
*/
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_F);
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
#endif /* EFI_PROD_CODE && EFI_ENGINE_CONTROL */
|
||||
|
||||
#if EFI_PWM_TESTER || defined(__DOXYGEN__)
|
||||
|
|
|
@ -98,7 +98,7 @@ void writeToFlashNow(void) {
|
|||
} else {
|
||||
scheduleMsg(logger, "Flashing failed");
|
||||
}
|
||||
assertEngineReference(PASS_ENGINE_PARAMETER_F);
|
||||
assertEngineReference(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
maxLockTime = 0;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ static bool isValidCrc(persistent_config_container_s *state) {
|
|||
}
|
||||
|
||||
static void doResetConfiguration(void) {
|
||||
resetConfigurationExt(logger, engineConfiguration->engineType PASS_ENGINE_PARAMETER);
|
||||
resetConfigurationExt(logger, engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
persisted_configuration_state_e flashState;
|
||||
|
@ -133,7 +133,7 @@ static persisted_configuration_state_e doReadConfiguration(flashaddr_t address,
|
|||
*/
|
||||
persisted_configuration_state_e readConfiguration(Logging * logger) {
|
||||
efiAssert(getRemainingStack(chThdGetSelfX()) > 256, "read f", PC_ERROR);
|
||||
assertEngineReference(PASS_ENGINE_PARAMETER_F);
|
||||
assertEngineReference(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
persisted_configuration_state_e result = doReadConfiguration(FLASH_ADDR, logger);
|
||||
if (result != PC_OK) {
|
||||
printMsg(logger, "Reading second configuration copy");
|
||||
|
@ -142,14 +142,14 @@ persisted_configuration_state_e readConfiguration(Logging * logger) {
|
|||
|
||||
if (result == CRC_FAILED) {
|
||||
warning(CUSTOM_ERR_FLASH_CRC_FAILED, "flash CRC failed");
|
||||
resetConfigurationExt(logger, DEFAULT_ENGINE_TYPE PASS_ENGINE_PARAMETER);
|
||||
resetConfigurationExt(logger, DEFAULT_ENGINE_TYPE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
} else if (result == INCOMPATIBLE_VERSION) {
|
||||
resetConfigurationExt(logger, engineConfiguration->engineType PASS_ENGINE_PARAMETER);
|
||||
resetConfigurationExt(logger, engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
} else {
|
||||
/**
|
||||
* At this point we know that CRC and version number is what we expect. Safe to assume it's a valid configuration.
|
||||
*/
|
||||
applyNonPersistentConfiguration(logger PASS_ENGINE_PARAMETER);
|
||||
applyNonPersistentConfiguration(logger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
// we can only change the state after the CRC check
|
||||
engineConfiguration->byFirmwareVersion = getRusEfiVersion();
|
||||
|
|
|
@ -184,7 +184,7 @@ percent_t getIdlePosition(void) {
|
|||
static void autoIdle() {
|
||||
efitimems_t now = currentTimeMillis();
|
||||
|
||||
percent_t newValue = idlePositionController.getIdle(getRpmE(engine), now PASS_ENGINE_PARAMETER);
|
||||
percent_t newValue = idlePositionController.getIdle(getRpmE(engine), now PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
if (currentIdleValve != newValue) {
|
||||
currentIdleValve = newValue;
|
||||
|
|
|
@ -126,7 +126,7 @@ void mapAveragingCallback(adcsample_t adcValue) {
|
|||
float voltage = adcToVoltsDivided(adcValue);
|
||||
float currentPressure = getMapByVoltage(voltage);
|
||||
scAddData(
|
||||
getCrankshaftAngleNt(getTimeNowNt() PASS_ENGINE_PARAMETER),
|
||||
getCrankshaftAngleNt(getTimeNowNt() PASS_ENGINE_PARAMETER_SUFFIX),
|
||||
currentPressure);
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ static void endAveraging(void *arg) {
|
|||
* Shaft Position callback used to schedule start and end of MAP averaging
|
||||
*/
|
||||
static void mapAveragingCallback(trigger_event_e ckpEventType,
|
||||
uint32_t index DECLARE_ENGINE_PARAMETER_S) {
|
||||
uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
// this callback is invoked on interrupt thread
|
||||
UNUSED(ckpEventType);
|
||||
engine->m.beforeMapAveragingCb = GET_TIMESTAMP();
|
||||
|
|
|
@ -35,7 +35,7 @@ EXTERN_ENGINE
|
|||
|
||||
extern EnginePins enginePins;
|
||||
|
||||
floatms_t getEngineCycleDuration(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t getEngineCycleDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
return getCrankshaftRevolutionTimeMs(rpm) * (engineConfiguration->operationMode == TWO_STROKE ? 1 : 2);
|
||||
}
|
||||
|
||||
|
@ -53,12 +53,12 @@ floatms_t getCrankshaftRevolutionTimeMs(int rpm) {
|
|||
* @brief Returns engine load according to selected engine_load_mode
|
||||
*
|
||||
*/
|
||||
float getEngineLoadT(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float getEngineLoadT(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
efiAssert(engine!=NULL, "engine 2NULL", NAN);
|
||||
efiAssert(engineConfiguration!=NULL, "engineConfiguration 2NULL", NAN);
|
||||
switch (engineConfiguration->fuelAlgorithm) {
|
||||
case LM_PLAIN_MAF:
|
||||
if (!hasMafSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (!hasMafSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
warning(CUSTOM_MAF_NEEDED, "MAF sensor needed for current fuel algorithm");
|
||||
return NAN;
|
||||
}
|
||||
|
@ -68,9 +68,9 @@ float getEngineLoadT(DECLARE_ENGINE_PARAMETER_F) {
|
|||
case LM_MAP:
|
||||
return getMap();
|
||||
case LM_ALPHA_N:
|
||||
return getTPS(PASS_ENGINE_PARAMETER_F);
|
||||
return getTPS(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
case LM_REAL_MAF: {
|
||||
return getRealMaf(PASS_ENGINE_PARAMETER_F);
|
||||
return getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
default:
|
||||
warning(CUSTOM_UNKNOWN_ALGORITHM, "Unexpected engine load parameter: %d", engineConfiguration->fuelAlgorithm);
|
||||
|
@ -107,7 +107,7 @@ void FuelSchedule::clear() {
|
|||
/**
|
||||
* @returns false in case of error, true if success
|
||||
*/
|
||||
bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_S) {
|
||||
bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
efiAssert(engine!=NULL, "engine is NULL", false);
|
||||
|
||||
floatus_t oneDegreeUs = ENGINE(rpmCalculator.oneDegreeUs); // local copy
|
||||
|
@ -137,12 +137,12 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
int index;
|
||||
|
||||
injection_mode_e mode = engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_F);
|
||||
injection_mode_e mode = engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
if (mode == IM_SIMULTANEOUS) {
|
||||
index = 0;
|
||||
} else if (mode == IM_SEQUENTIAL) {
|
||||
index = getCylinderId(i PASS_ENGINE_PARAMETER) - 1;
|
||||
index = getCylinderId(i PASS_ENGINE_PARAMETER_SUFFIX) - 1;
|
||||
} else if (mode == IM_BATCH) {
|
||||
// does not look exactly right, not too consistent with IM_SEQUENTIAL
|
||||
index = i % (engineConfiguration->specs.cylindersCount / 2);
|
||||
|
@ -199,20 +199,20 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_S) {
|
|||
return false;
|
||||
}
|
||||
|
||||
TRIGGER_SHAPE(findTriggerPosition(&ev->injectionStart, angle PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&ev->injectionStart, angle PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
#if EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||
printf("registerInjectionEvent angle=%f trgIndex=%d inj %d\r\n", angle, ev->injectionStart.eventIndex, index);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
void FuelSchedule::addFuelEvents(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void FuelSchedule::addFuelEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
clear();
|
||||
|
||||
for (int i = 0; i < CONFIG(specs.cylindersCount); i++) {
|
||||
InjectionEvent *ev = &elements[i];
|
||||
ev->ownIndex = i;
|
||||
bool result = addFuelEventsForCylinder(i PASS_ENGINE_PARAMETER);
|
||||
bool result = addFuelEventsForCylinder(i PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (!result)
|
||||
return;
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ void FuelSchedule::addFuelEvents(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
#endif
|
||||
|
||||
floatms_t getCrankingSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t getCrankingSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (engineConfiguration->useConstantDwellDuringCranking) {
|
||||
return engineConfiguration->ignitionDwellForCrankingMs;
|
||||
} else {
|
||||
|
@ -234,10 +234,10 @@ floatms_t getCrankingSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
/**
|
||||
* @return Spark dwell time, in milliseconds. 0 if tables are not ready.
|
||||
*/
|
||||
floatms_t getSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t getSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
float dwellMs;
|
||||
if (isCrankingR(rpm)) {
|
||||
dwellMs = getCrankingSparkDwell(rpm PASS_ENGINE_PARAMETER);
|
||||
dwellMs = getCrankingSparkDwell(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
} else {
|
||||
efiAssert(!cisnan(rpm), "invalid rpm", NAN);
|
||||
|
||||
|
@ -255,7 +255,7 @@ floatms_t getSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
/**
|
||||
* this method is only used on initialization
|
||||
*/
|
||||
int TriggerShape::findAngleIndex(float target DECLARE_ENGINE_PARAMETER_S) {
|
||||
int TriggerShape::findAngleIndex(float target DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
int engineCycleEventCount = TRIGGER_SHAPE(getLength());
|
||||
|
||||
efiAssert(engineCycleEventCount > 0, "engineCycleEventCount", 0);
|
||||
|
@ -283,7 +283,7 @@ int TriggerShape::findAngleIndex(float target DECLARE_ENGINE_PARAMETER_S) {
|
|||
return left - 1;
|
||||
}
|
||||
|
||||
void TriggerShape::findTriggerPosition(event_trigger_position_s *position, angle_t angleOffset DECLARE_ENGINE_PARAMETER_S) {
|
||||
void TriggerShape::findTriggerPosition(event_trigger_position_s *position, angle_t angleOffset DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
// convert engine cycle angle into trigger cycle angle
|
||||
angleOffset += tdcPosition();
|
||||
fixAngle(angleOffset, "addFuel#2");
|
||||
|
@ -330,7 +330,7 @@ static int order_1_10_9_4_3_6_5_8_7_2[] = {1, 10, 9, 4, 3, 6, 5, 8, 7, 2};
|
|||
// 12 cyliner
|
||||
static int order_1_7_5_11_3_9_6_12_2_8_4_10[] = {1, 7, 5, 11, 3, 9, 6, 12, 2, 8, 4, 10};
|
||||
|
||||
static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
||||
switch (CONFIG(specs.firingOrder)) {
|
||||
case FO_1:
|
||||
|
@ -382,9 +382,9 @@ static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_F) {
|
|||
* @param index from zero to cylindersCount - 1
|
||||
* @return cylinderId from one to cylindersCount
|
||||
*/
|
||||
int getCylinderId(int index DECLARE_ENGINE_PARAMETER_S) {
|
||||
int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
|
||||
const int foLength = getFiringOrderLength(PASS_ENGINE_PARAMETER_F);
|
||||
const int foLength = getFiringOrderLength(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
if (engineConfiguration->specs.cylindersCount != foLength) {
|
||||
warning(CUSTOM_OBD_WRONG_FIRING_ORDER, "Wrong firing order %d/%d", engineConfiguration->specs.cylindersCount, foLength);
|
||||
return 1;
|
||||
|
@ -442,7 +442,7 @@ int getCylinderId(int index DECLARE_ENGINE_PARAMETER_S) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int getIgnitionPinForIndex(int i DECLARE_ENGINE_PARAMETER_S) {
|
||||
static int getIgnitionPinForIndex(int i DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
switch (CONFIG(ignitionMode)) {
|
||||
case IM_ONE_COIL:
|
||||
return 0;
|
||||
|
@ -461,10 +461,10 @@ static int getIgnitionPinForIndex(int i DECLARE_ENGINE_PARAMETER_S) {
|
|||
}
|
||||
}
|
||||
|
||||
void TriggerShape::prepareShape(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void TriggerShape::prepareShape(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
int engineCycleInt = (int) getEngineCycle(CONFIG(operationMode));
|
||||
for (int angle = 0; angle < engineCycleInt; angle++) {
|
||||
int triggerShapeIndex = findAngleIndex(angle PASS_ENGINE_PARAMETER);
|
||||
int triggerShapeIndex = findAngleIndex(angle PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (engineConfiguration->useOnlyRisingEdgeForTrigger) {
|
||||
// we need even index for front_only mode - so if odd indexes are rounded down
|
||||
triggerShapeIndex = triggerShapeIndex & 0xFFFFFFFE;
|
||||
|
@ -478,7 +478,7 @@ void TriggerShape::prepareShape(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* This heavy method is only invoked in case of a configuration change or initialization.
|
||||
*/
|
||||
void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
ENGINE(engineCycle) = getEngineCycle(CONFIG(operationMode));
|
||||
|
||||
angle_t maxTimingCorrMap = -720.0f;
|
||||
|
@ -491,7 +491,7 @@ void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
floatms_t crankingDwell = getCrankingSparkDwell(CONFIG(cranking.rpm) PASS_ENGINE_PARAMETER);
|
||||
floatms_t crankingDwell = getCrankingSparkDwell(CONFIG(cranking.rpm) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// dwell at cranking is constant angle or constant time, dwell at cranking threshold is the highest angle duration
|
||||
// lower RPM angle duration goes up
|
||||
|
@ -531,47 +531,47 @@ void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
for (int i = 0; i < CONFIG(specs.cylindersCount); i++) {
|
||||
ENGINE(angleExtra[i])= ENGINE(engineCycle) * i / CONFIG(specs.cylindersCount);
|
||||
ENGINE(ignitionPin[i]) = getIgnitionPinForIndex(i PASS_ENGINE_PARAMETER);
|
||||
ENGINE(ignitionPin[i]) = getIgnitionPinForIndex(i PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
TRIGGER_SHAPE(prepareShape(PASS_ENGINE_PARAMETER_F));
|
||||
TRIGGER_SHAPE(prepareShape(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void setFuelRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setFuelRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setTableBin(config->fuelRpmBins, FUEL_RPM_COUNT, from, to);
|
||||
}
|
||||
|
||||
void setFuelLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setFuelLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setTableBin(config->fuelLoadBins, FUEL_LOAD_COUNT, from, to);
|
||||
}
|
||||
|
||||
void setTimingRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setTimingRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setRpmBin(config->ignitionRpmBins, IGN_RPM_COUNT, from, to);
|
||||
}
|
||||
|
||||
void setTimingLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setTimingLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setTableBin(config->ignitionLoadBins, IGN_LOAD_COUNT, from, to);
|
||||
}
|
||||
|
||||
/**
|
||||
* this method sets algorithm and ignition table scale
|
||||
*/
|
||||
void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
engineConfiguration->fuelAlgorithm = algo;
|
||||
if (algo == LM_ALPHA_N) {
|
||||
setTimingLoadBin(20, 120 PASS_ENGINE_PARAMETER);
|
||||
setTimingLoadBin(20, 120 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
} else if (algo == LM_SPEED_DENSITY) {
|
||||
setTableBin2(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 120, 3);
|
||||
buildTimingMap(35 PASS_ENGINE_PARAMETER);
|
||||
buildTimingMap(35 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
|
||||
void setInjectorLag(float value DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setInjectorLag(float value DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setArrayValues(engineConfiguration->injector.battLagCorr, VBAT_INJECTOR_CURVE_SIZE, value);
|
||||
}
|
||||
|
||||
void assertEngineReference(DECLARE_ENGINE_PARAMETER_F) {
|
||||
void assertEngineReference(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
efiAssertVoid(engine != NULL, "engine is NULL");
|
||||
}
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
initThermistors(sharedLogger PASS_ENGINE_PARAMETER);
|
||||
initMapDecoder(sharedLogger PASS_ENGINE_PARAMETER);
|
||||
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
initThermistors(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
initMapDecoder(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
// todo: move this somewhere else? maybe.
|
||||
bool getAcToggle(DECLARE_ENGINE_PARAMETER_F) {
|
||||
bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
/**
|
||||
* todo: make this flexible
|
||||
*
|
||||
|
|
|
@ -66,7 +66,7 @@ static FastInterpolation dodgeNeon2003(0.4 /* volts */, 15.34 /* kPa */, 4.5 /*
|
|||
*/
|
||||
static FastInterpolation *mapDecoder;
|
||||
|
||||
float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DECLARE_ENGINE_PARAMETER_S) {
|
||||
float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
switch (mapConfig->type) {
|
||||
case MT_CUSTOM:
|
||||
// todo: migrate to 'FastInterpolation customMap'
|
||||
|
@ -98,7 +98,7 @@ float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DEC
|
|||
* This function adds an error if MAP sensor value is outside of expected range
|
||||
* @return unchanged mapKPa parameter
|
||||
*/
|
||||
float validateMap(float mapKPa DECLARE_ENGINE_PARAMETER_S) {
|
||||
float validateMap(float mapKPa DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (cisnan(mapKPa) || mapKPa < CONFIG(mapErrorDetectionTooLow) || mapKPa > CONFIG(mapErrorDetectionTooHigh)) {
|
||||
warning(OBD_Manifold_Absolute_Pressure_Circuit_Malfunction, "unexpected MAP value: %f", mapKPa);
|
||||
return 0;
|
||||
|
@ -110,7 +110,7 @@ float validateMap(float mapKPa DECLARE_ENGINE_PARAMETER_S) {
|
|||
* @brief MAP value decoded according to current settings
|
||||
* @returns kPa value
|
||||
*/
|
||||
float getMapByVoltage(float voltage DECLARE_ENGINE_PARAMETER_S) {
|
||||
float getMapByVoltage(float voltage DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_ENABLE_MOCK_ADC || defined(__DOXYGEN__)
|
||||
int mapChannel = engineConfiguration->map.sensor.hwChannel;
|
||||
if (engine->engineState.mockAdcState.hasMockAdc[mapChannel])
|
||||
|
@ -119,32 +119,32 @@ float getMapByVoltage(float voltage DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
// todo: migrate to mapDecoder once parameter listeners are ready
|
||||
air_pressure_sensor_config_s * apConfig = &engineConfiguration->map.sensor;
|
||||
return decodePressure(voltage, apConfig PASS_ENGINE_PARAMETER);
|
||||
return decodePressure(voltage, apConfig PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Manifold Absolute Pressure, in kPa
|
||||
*/
|
||||
float getRawMap(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float getRawMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (engineConfiguration->hasFrequencyReportingMapSensor) {
|
||||
return interpolate(boardConfiguration->mapFrequency0Kpa, 0, boardConfiguration->mapFrequency100Kpa, 100, mapFreq);
|
||||
}
|
||||
|
||||
float voltage = getVoltageDivided("map", engineConfiguration->map.sensor.hwChannel);
|
||||
return getMapByVoltage(voltage PASS_ENGINE_PARAMETER);
|
||||
return getMapByVoltage(voltage PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
bool hasBaroSensor(DECLARE_ENGINE_PARAMETER_F) {
|
||||
bool hasBaroSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return engineConfiguration->baroSensor.hwChannel != EFI_ADC_NONE;
|
||||
}
|
||||
|
||||
bool hasMapSensor(DECLARE_ENGINE_PARAMETER_F) {
|
||||
bool hasMapSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return engineConfiguration->map.sensor.hwChannel != EFI_ADC_NONE;
|
||||
}
|
||||
|
||||
float getBaroPressure(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float getBaroPressure(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
float voltage = getVoltageDivided("baro", engineConfiguration->baroSensor.hwChannel);
|
||||
return decodePressure(voltage, &engineConfiguration->baroSensor PASS_ENGINE_PARAMETER);
|
||||
return decodePressure(voltage, &engineConfiguration->baroSensor PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
static FastInterpolation *getDecoder(air_pressure_sensor_type_e type) {
|
||||
|
@ -169,7 +169,7 @@ static FastInterpolation *getDecoder(air_pressure_sensor_type_e type) {
|
|||
}
|
||||
}
|
||||
|
||||
static void applyConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void applyConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
air_pressure_sensor_config_s * apConfig = &engineConfiguration->map.sensor;
|
||||
customMap.init(0, apConfig->lowValue, 5, apConfig->highValue);
|
||||
mapDecoder = getDecoder(engineConfiguration->map.sensor.type);
|
||||
|
@ -210,7 +210,7 @@ static void printMAPInfo(void) {
|
|||
}
|
||||
}
|
||||
|
||||
if (hasBaroSensor(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (hasBaroSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
scheduleMsg(logger, "baro type=%d value=%f", engineConfiguration->baroSensor.type, getBaroPressure());
|
||||
if (engineConfiguration->baroSensor.type == MT_CUSTOM) {
|
||||
scheduleMsg(logger, "min=%f@%f max=%f@%f",
|
||||
|
@ -225,9 +225,9 @@ static void printMAPInfo(void) {
|
|||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
|
||||
void initMapDecoder(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initMapDecoder(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
logger = sharedLogger;
|
||||
applyConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
applyConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
//engine->configurationListeners.registerCallback(applyConfiguration);
|
||||
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
|
@ -244,7 +244,7 @@ void initMapDecoder(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
#else /* EFI_ANALOG_SENSORS */
|
||||
|
||||
void initMapDecoder(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initMapDecoder(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
}
|
||||
|
||||
#endif /* EFI_ANALOG_SENSORS */
|
||||
|
|
|
@ -57,7 +57,7 @@ float getTpsRateOfChange(void) {
|
|||
* Return current TPS position based on configured ADC levels, and adc
|
||||
*
|
||||
* */
|
||||
percent_t getTpsValue(int adc DECLARE_ENGINE_PARAMETER_S) {
|
||||
percent_t getTpsValue(int adc DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (engineConfiguration->tpsMin == engineConfiguration->tpsMax) {
|
||||
warning(CUSTOM_INVALID_TPS_SETTING, "Invalid TPS configuration: same value %d", engineConfiguration->tpsMin);
|
||||
return NAN;
|
||||
|
@ -83,7 +83,7 @@ percent_t getTpsValue(int adc DECLARE_ENGINE_PARAMETER_S) {
|
|||
/*
|
||||
* Return voltage on TPS AND channel
|
||||
* */
|
||||
float getTPSVoltage(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float getTPSVoltage(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return getVoltageDivided("tps", engineConfiguration->tpsAdcChannel);
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ float getTPSVoltage(DECLARE_ENGINE_PARAMETER_F) {
|
|||
* We need ADC value because TunerStudio has a nice TPS configuration wizard, and this wizard
|
||||
* wants a TPS value.
|
||||
*/
|
||||
int getTPS12bitAdc(DECLARE_ENGINE_PARAMETER_F) {
|
||||
int getTPS12bitAdc(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
#if !EFI_PROD_CODE
|
||||
if (mockTps != MOCK_UNDEFINED)
|
||||
return mockTps;
|
||||
|
@ -111,18 +111,18 @@ int getTPS12bitAdc(DECLARE_ENGINE_PARAMETER_F) {
|
|||
/**
|
||||
* @brief Position on physical primary TPS
|
||||
*/
|
||||
static percent_t getPrimatyRawTPS(DECLARE_ENGINE_PARAMETER_F) {
|
||||
percent_t tpsValue = getTpsValue(getTPS12bitAdc(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER);
|
||||
static percent_t getPrimatyRawTPS(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
percent_t tpsValue = getTpsValue(getTPS12bitAdc(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
return tpsValue;
|
||||
}
|
||||
|
||||
#define NO_TPS_MAGIC_VALUE 66.611
|
||||
|
||||
bool hasPedalPositionSensor(DECLARE_ENGINE_PARAMETER_F) {
|
||||
bool hasPedalPositionSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return engineConfiguration->pedalPositionChannel != EFI_ADC_NONE;
|
||||
}
|
||||
|
||||
percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_F) {
|
||||
percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
float voltage = getVoltageDivided("pPS", engineConfiguration->pedalPositionChannel);
|
||||
float result = interpolate(engineConfiguration->pedalPositionMin, 0, engineConfiguration->pedalPositionMax, 100, voltage);
|
||||
|
||||
|
@ -130,18 +130,18 @@ percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_F) {
|
|||
return maxF(0, minF(100, result));
|
||||
}
|
||||
|
||||
bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_F) {
|
||||
bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return engineConfiguration->tpsAdcChannel != EFI_ADC_NONE;
|
||||
}
|
||||
|
||||
percent_t getTPS(DECLARE_ENGINE_PARAMETER_F) {
|
||||
if (!hasTpsSensor(PASS_ENGINE_PARAMETER_F))
|
||||
percent_t getTPS(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (!hasTpsSensor(PASS_ENGINE_PARAMETER_SIGNATURE))
|
||||
return NO_TPS_MAGIC_VALUE;
|
||||
// todo: if (config->isDualTps)
|
||||
// todo: blah blah
|
||||
// todo: if two TPS do not match - show OBD code via malfunction_central.c
|
||||
|
||||
return getPrimatyRawTPS(PASS_ENGINE_PARAMETER_F);
|
||||
return getPrimatyRawTPS(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
int convertVoltageTo10bitADC(float voltage) {
|
||||
|
|
|
@ -298,20 +298,20 @@ static void doPrintConfiguration() {
|
|||
static void setFixedModeTiming(int value) {
|
||||
engineConfiguration->fixedModeTiming = value;
|
||||
doPrintConfiguration();
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void setTimingMode(int value) {
|
||||
engineConfiguration->timingMode = (timing_mode_e) value;
|
||||
doPrintConfiguration();
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
void setEngineType(int value) {
|
||||
// enginePins.stopPins(); // this is mostly needed by functional tests
|
||||
|
||||
engineConfiguration->engineType = (engine_type_e) value;
|
||||
resetConfigurationExt(&logger, (engine_type_e) value PASS_ENGINE_PARAMETER);
|
||||
resetConfigurationExt(&logger, (engine_type_e) value PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#if EFI_ENGINE_SNIFFER || defined(__DOXYGEN__)
|
||||
if (engine->isTestMode)
|
||||
waveChart.reset();
|
||||
|
@ -321,7 +321,7 @@ void setEngineType(int value) {
|
|||
writeToFlashNow();
|
||||
// scheduleReset();
|
||||
#endif /* EFI_PROD_CODE */
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
doPrintConfiguration();
|
||||
}
|
||||
|
||||
|
@ -347,13 +347,13 @@ static void setIdlePinMode(int value) {
|
|||
static void setInjectionOffset(float value) {
|
||||
engineConfiguration->extraInjectionOffset = value;
|
||||
doPrintConfiguration();
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void setIgnitionOffset(float value) {
|
||||
engineConfiguration->ignitionOffset = value;
|
||||
doPrintConfiguration();
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void setFuelPumpPinMode(int value) {
|
||||
|
@ -409,20 +409,20 @@ static void printTPSInfo(void) {
|
|||
static char pinNameBuffer[16];
|
||||
|
||||
scheduleMsg(&logger, "tps min (closed) %d/max (full) %d v=%f @%s", engineConfiguration->tpsMin, engineConfiguration->tpsMax,
|
||||
getTPSVoltage(PASS_ENGINE_PARAMETER_F), getPinNameByAdcChannel("tps", engineConfiguration->tpsAdcChannel, pinNameBuffer));
|
||||
getTPSVoltage(PASS_ENGINE_PARAMETER_SIGNATURE), getPinNameByAdcChannel("tps", engineConfiguration->tpsAdcChannel, pinNameBuffer));
|
||||
#endif /* EFI_PROD_CODE */
|
||||
scheduleMsg(&logger, "current 10bit=%d value=%f rate=%f", getTPS12bitAdc() / TPS_TS_CONVERSION, getTPS(PASS_ENGINE_PARAMETER_F),
|
||||
scheduleMsg(&logger, "current 10bit=%d value=%f rate=%f", getTPS12bitAdc() / TPS_TS_CONVERSION, getTPS(PASS_ENGINE_PARAMETER_SIGNATURE),
|
||||
getTpsRateOfChange());
|
||||
}
|
||||
|
||||
static void printTemperatureInfo(void) {
|
||||
#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__)
|
||||
printThermistor("CLT", &engineConfiguration->clt, &engine->engineState.cltCurve);
|
||||
if (!isValidCoolantTemperature(getCoolantTemperature(PASS_ENGINE_PARAMETER_F))) {
|
||||
if (!isValidCoolantTemperature(getCoolantTemperature(PASS_ENGINE_PARAMETER_SIGNATURE))) {
|
||||
scheduleMsg(&logger, "CLT sensing error");
|
||||
}
|
||||
printThermistor("IAT", &engineConfiguration->iat, &engine->engineState.iatCurve);
|
||||
if (!isValidIntakeAirTemperature(getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F))) {
|
||||
if (!isValidIntakeAirTemperature(getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE))) {
|
||||
scheduleMsg(&logger, "IAT sensing error");
|
||||
}
|
||||
|
||||
|
@ -484,31 +484,31 @@ static void setGlobalTriggerAngleOffset(float value) {
|
|||
return;
|
||||
}
|
||||
engineConfiguration->globalTriggerAngleOffset = value;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
doPrintConfiguration();
|
||||
}
|
||||
|
||||
static void setCrankingTimingAngle(float value) {
|
||||
engineConfiguration->crankingTimingAngle = value;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
doPrintConfiguration();
|
||||
}
|
||||
|
||||
static void setCrankingInjectionMode(int value) {
|
||||
engineConfiguration->crankingInjectionMode = (injection_mode_e) value;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
doPrintConfiguration();
|
||||
}
|
||||
|
||||
static void setInjectionMode(int value) {
|
||||
engineConfiguration->injectionMode = (injection_mode_e) value;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
doPrintConfiguration();
|
||||
}
|
||||
|
||||
static void setIgnitionMode(int value) {
|
||||
engineConfiguration->ignitionMode = (ignition_mode_e) value;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
doPrintConfiguration();
|
||||
}
|
||||
|
||||
|
@ -526,7 +526,7 @@ static void setIndividualCoilsIgnition(void) {
|
|||
|
||||
static void setTriggerType(int value) {
|
||||
engineConfiguration->trigger.type = (trigger_type_e) value;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
doPrintConfiguration();
|
||||
}
|
||||
|
||||
|
@ -534,7 +534,7 @@ static void setDebugMode(int value) {
|
|||
engineConfiguration->debugMode = (debug_mode_e) value;
|
||||
}
|
||||
|
||||
static void setToothedWheel(int total, int skipped DECLARE_ENGINE_PARAMETER_S) {
|
||||
static void setToothedWheel(int total, int skipped DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (total < 1 || skipped >= total) {
|
||||
scheduleMsg(&logger, "invalid parameters %d %d", total, skipped);
|
||||
return;
|
||||
|
@ -546,13 +546,13 @@ static void setToothedWheel(int total, int skipped DECLARE_ENGINE_PARAMETER_S) {
|
|||
scheduleMsg(&logger, "toothed: total=%d/skipped=%d", total, skipped);
|
||||
setToothedWheelConfiguration(&engine->triggerCentral.triggerShape, total, skipped, engineConfiguration->operationMode);
|
||||
// initializeTriggerShape(&logger, engineConfiguration, engineConfiguration2);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
doPrintConfiguration();
|
||||
}
|
||||
|
||||
static void setCrankingChargeAngle(float value) {
|
||||
engineConfiguration->crankingChargeAngle = value;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
doPrintConfiguration();
|
||||
}
|
||||
|
||||
|
@ -617,7 +617,7 @@ static void setWholeFuelMapCmd(float value) {
|
|||
if (engineConfiguration->fuelAlgorithm == LM_SPEED_DENSITY) {
|
||||
scheduleMsg(&logger, "WARNING: setting fuel map in SD mode is pointless");
|
||||
}
|
||||
setWholeFuelMap(value PASS_ENGINE_PARAMETER);
|
||||
setWholeFuelMap(value PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
|
@ -642,7 +642,7 @@ static void setIgnitionPin(const char *indexStr, const char *pinName) {
|
|||
}
|
||||
scheduleMsg(&logger, "setting ignition pin[%d] to %s please save&restart", index, hwPortname(pin));
|
||||
boardConfiguration->ignitionPins[index] = pin;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void setIndividualPin(const char *pinName, brain_pin_e *targetPin, const char *name) {
|
||||
|
@ -653,7 +653,7 @@ static void setIndividualPin(const char *pinName, brain_pin_e *targetPin, const
|
|||
}
|
||||
scheduleMsg(&logger, "setting %s pin to %s please save&restart", name, hwPortname(pin));
|
||||
*targetPin = pin;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
// set_idle_pin none
|
||||
|
@ -689,7 +689,7 @@ static void setInjectionPin(const char *indexStr, const char *pinName) {
|
|||
}
|
||||
scheduleMsg(&logger, "setting injection pin[%d] to %s please save&restart", index, hwPortname(pin));
|
||||
boardConfiguration->injectionPins[index] = pin;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void setTriggerInputPin(const char *indexStr, const char *pinName) {
|
||||
|
@ -704,7 +704,7 @@ static void setTriggerInputPin(const char *indexStr, const char *pinName) {
|
|||
}
|
||||
scheduleMsg(&logger, "setting trigger pin[%d] to %s please save&restart", index, hwPortname(pin));
|
||||
boardConfiguration->triggerInputPins[index] = pin;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void setTriggerSimulatorMode(const char *indexStr, const char *modeCode) {
|
||||
|
@ -730,7 +730,7 @@ static void setEgtCSPin(const char *indexStr, const char *pinName) {
|
|||
}
|
||||
scheduleMsg(&logger, "setting EGT CS pin[%d] to %s please save&restart", index, hwPortname(pin));
|
||||
boardConfiguration->max31855_cs[index] = pin;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
static void setTriggerSimulatorPin(const char *indexStr, const char *pinName) {
|
||||
|
@ -744,7 +744,7 @@ static void setTriggerSimulatorPin(const char *indexStr, const char *pinName) {
|
|||
}
|
||||
scheduleMsg(&logger, "setting trigger simulator pin[%d] to %s please save&restart", index, hwPortname(pin));
|
||||
boardConfiguration->triggerSimulatorPins[index] = pin;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
#if HAL_USE_ADC || defined(__DOXYGEN__)
|
||||
|
@ -772,7 +772,7 @@ static void setAnalogInputPin(const char *sensorStr, const char *pinName) {
|
|||
engineConfiguration->tpsAdcChannel = channel;
|
||||
scheduleMsg(&logger, "setting TPS to %s/%d", pinName, channel);
|
||||
}
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -866,16 +866,16 @@ static void enableOrDisable(const char *param, bool isEnabled) {
|
|||
boardConfiguration->useStepperIdle = isEnabled;
|
||||
} else if (strEqualCaseInsensitive(param, "trigger_only_front")) {
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = isEnabled;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
} else if (strEqualCaseInsensitive(param, "use_only_first_channel")) {
|
||||
engineConfiguration->trigger.useOnlyFirstChannel = isEnabled;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
} else if (strEqualCaseInsensitive(param, "two_wire_batch_injection")) {
|
||||
engineConfiguration->twoWireBatchInjection = isEnabled;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
} else if (strEqualCaseInsensitive(param, "two_wire_wasted_spark")) {
|
||||
engineConfiguration->twoWireBatchIgnition = isEnabled;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
} else if (strEqualCaseInsensitive(param, "HIP9011")) {
|
||||
boardConfiguration->isHip9011Enabled = isEnabled;
|
||||
} else if (strEqualCaseInsensitive(param, "auxdebug1")) {
|
||||
|
@ -1210,7 +1210,7 @@ static void setValue(const char *paramStr, const char *valueStr) {
|
|||
} else if (strEqualCaseInsensitive(paramStr, "warning_period")) {
|
||||
engineConfiguration->warningPeriod = valueI;
|
||||
} else if (strEqualCaseInsensitive(paramStr, "dwell")) {
|
||||
setConstantDwell(valueF PASS_ENGINE_PARAMETER);
|
||||
setConstantDwell(valueF PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
} else if (strEqualCaseInsensitive(paramStr, "engineSnifferRpmThreshold")) {
|
||||
engineConfiguration->engineSnifferRpmThreshold = valueI;
|
||||
} else if (strEqualCaseInsensitive(paramStr, "step1rpm")) {
|
||||
|
|
|
@ -7,63 +7,63 @@
|
|||
|
||||
#include "trigger_bmw.h"
|
||||
|
||||
static inline float addPair(TriggerShape *s, float a, float w DECLARE_ENGINE_PARAMETER_S) {
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
static inline float addPair(TriggerShape *s, float a, float w DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
return a;
|
||||
}
|
||||
|
||||
void configureMiniCooperTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureMiniCooperTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
// s->initialState[0] = 1;
|
||||
|
||||
float w = 360.0 / 121;
|
||||
float a = w / 2;
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
|
||||
for (int i = 0; i <= 22; i++) {
|
||||
a = addPair(s, a, w PASS_ENGINE_PARAMETER);
|
||||
a = addPair(s, a, w PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
a += 3 * w;
|
||||
|
||||
float firstGapAngle = a;
|
||||
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += 3 * w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
|
||||
for (int i = 0; i < 36; i++) {
|
||||
a = addPair(s, a, w PASS_ENGINE_PARAMETER);
|
||||
a = addPair(s, a, w PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
s->addEvent2(376, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(376, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
for (int i = 0; i < 21; i++) {
|
||||
a = addPair(s, a, w PASS_ENGINE_PARAMETER);
|
||||
a = addPair(s, a, w PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
a += 3 * w;
|
||||
|
||||
efiAssertVoid(absF(firstGapAngle + 360 - a) < 0.1, "shape constraint");
|
||||
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += 3 * w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
|
||||
for (int i = 0; i < 33; i++) {
|
||||
a = addPair(s, a, w PASS_ENGINE_PARAMETER);
|
||||
a = addPair(s, a, w PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
efiAssertVoid(absF(720 - w / 2 - a) < 0.1, "shape constraint");
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(720.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
/**
|
||||
* With just one tooth on camshaft synchronization is not needed
|
||||
|
|
|
@ -9,99 +9,99 @@
|
|||
#include "trigger_decoder.h"
|
||||
#include "trigger_universal.h"
|
||||
|
||||
void initDodgeRam(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initDodgeRam(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
s->useRiseEdge = true;
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, 8, 0, 0.06, -25, 360, 0, 720 PASS_ENGINE_PARAMETER);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, 8, 0, 0.06, -25, 360, 0, 720 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, 8, 0, 0.06, 360 - 25, 360, 0,
|
||||
720 PASS_ENGINE_PARAMETER);
|
||||
720 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
void configureNeon2003TriggerShapeCrank(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureNeon2003TriggerShapeCrank(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
|
||||
s->useRiseEdge = true;
|
||||
|
||||
s->setTriggerSynchronizationGap(3);
|
||||
int m = 2;
|
||||
|
||||
s->addEvent2(m * 25, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 30, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 35, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 40, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 45, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 50, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 55, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 60, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 65, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 70, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 75, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 80, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 85, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 90, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 95, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 100, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 105, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 110, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 115, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 120, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 125, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 130, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 135, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 140, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 145,T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 150, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 155, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 160, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 165, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 170, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 175, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 180, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 185, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 25, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 30, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 35, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 40, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 45, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 50, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 55, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 60, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 65, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 70, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 75, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 80, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 85, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 90, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 95, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 100, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 105, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 110, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 115, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 120, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 125, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 130, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 135, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 140, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 145,T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 150, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 155, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 160, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 165, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 170, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 175, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 180, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 185, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// gap 25
|
||||
s->addEvent2(m * 210, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 215, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 220, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 225, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 230, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 235, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 240, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 245, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 250, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 255, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 260, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 265, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 270, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 275, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 280, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 285, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 290, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 295, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 300, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 305, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 310, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 315, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 320, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 325, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 330, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 335, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 340, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 345, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 350, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 355, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 210, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 215, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 220, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 225, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 230, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 235, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 240, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 245, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 250, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 255, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 260, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 265, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 270, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 275, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 280, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 285, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 290, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 295, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 300, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 305, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 310, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 315, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 320, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 325, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 330, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 335, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 340, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 345, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 350, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 355, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void configureNeon2003TriggerShapeCam(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureNeon2003TriggerShapeCam(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
// todo: move sync point so that two channel does not have false trigger issues
|
||||
bool useOnlyPrimary = true;
|
||||
|
||||
|
@ -131,23 +131,23 @@ gap=1.43/0.71
|
|||
s->useOnlyPrimaryForSync = true;
|
||||
|
||||
if (useOnlyPrimary) {
|
||||
s->addEvent2(144, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(180, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(144, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(180, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(216, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(252, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(216, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(252, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(288, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(324, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(288, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(324, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER); // width = 144
|
||||
s->addEvent2(504, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER); // width = 36
|
||||
s->addEvent2(540, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(576, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(612, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(648, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(684, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX); // width = 144
|
||||
s->addEvent2(504, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX); // width = 36
|
||||
s->addEvent2(540, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(576, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(612, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(648, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(684, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
} else {
|
||||
/**
|
||||
|
@ -156,175 +156,175 @@ gap=1.43/0.71
|
|||
*
|
||||
*/
|
||||
|
||||
s->addEvent2(25, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(30, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(35, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(40, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(45, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(50, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(60, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(65, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(70, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(75, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(80, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(85, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(90, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(100, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(105, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(110, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(115, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(120, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(125, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(130, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(135, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(140, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(25, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(30, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(35, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(40, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(45, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(50, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(60, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(65, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(70, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(75, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(80, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(85, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(90, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(95, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(100, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(105, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(110, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(115, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(120, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(125, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(130, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(135, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(140, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(144, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(144, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(145,T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(150, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(155, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(160, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(165, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(170, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(175, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(180 - EPS_ANGLE, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(145,T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(150, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(155, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(160, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(165, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(170, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(175, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(180 - EPS_ANGLE, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(180, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(180, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(185, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(210, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(215, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(185, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(210, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(215, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(216, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(216, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(220, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(225, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(230, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(235, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(240, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(245, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(250, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(220, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(225, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(230, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(235, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(240, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(245, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(250, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(252, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(252, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(255, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(255, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(260, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(265, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(270, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(275, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(280, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(285, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(260, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(265, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(270, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(275, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(280, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(285, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(288, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(288, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(290, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(295, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(300, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(305, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(310, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(315, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(320, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(290, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(295, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(300, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(305, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(310, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(315, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(320, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(324, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(324, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(325, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(330, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(335, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(340, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(345, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(350, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(355, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360 - EPS_ANGLE, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(325, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(330, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(335, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(340, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(345, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(350, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(355, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(360 - EPS_ANGLE, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(385, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(390, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(395, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(400, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(405, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(410, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(415, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(420, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(425, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(430, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(435, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(440, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(445, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(450, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(455, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(460, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(465, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(470, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(475, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(480, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(485, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(490, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(495, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(500, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(385, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(390, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(395, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(400, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(405, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(410, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(415, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(420, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(425, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(430, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(435, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(440, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(445, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(450, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(455, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(460, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(465, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(470, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(475, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(480, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(485, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(490, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(495, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(500, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(504, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(504, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(505, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(510, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(515, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(520, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(525, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(530, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(535, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(540 - EPS_ANGLE, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(505, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(510, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(515, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(520, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(525, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(530, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(535, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(540 - EPS_ANGLE, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(540, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(540, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(545, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(570, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(575, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(545, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(570, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(575, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(576, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(580, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(585, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(590, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(595, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(600, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(605, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(610, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(576, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(580, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(585, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(590, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(595, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(600, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(605, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(610, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(612, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(615, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(620, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(625, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(630, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(635, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(640, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(645, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(612, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(615, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(620, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(625, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(630, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(635, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(640, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(645, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(648, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(650, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(655, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(660, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(665, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(670, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(675, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(680, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(648, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(650, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(655, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(660, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(665, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(670, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(675, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(680, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(684, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(685, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(690, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(695, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(700, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(705, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(710, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(715, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720 - EPS_ANGLE, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(684, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(685, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(690, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(695, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(700, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(705, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(710, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(715, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720 - EPS_ANGLE, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
|
||||
void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, false);
|
||||
s->isSynchronizationNeeded = true;
|
||||
|
||||
|
@ -338,59 +338,59 @@ void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_
|
|||
float base = 0;
|
||||
// 2 teeth
|
||||
float angle = base + 120.0 - w;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
angle += g;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
base += 120;
|
||||
// 3 teeth
|
||||
angle = base + 120.0 - w;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
angle += g;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
angle += g;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
base += 120;
|
||||
// 2 teeth
|
||||
angle = base + 120.0 - w;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
angle += g;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
base += 120;
|
||||
// just one
|
||||
angle = base + 120.0 - w;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
base += 120;
|
||||
// 3 teeth
|
||||
angle = base + 120.0 - w;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
angle += g;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
angle += g;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
base += 120;
|
||||
// just one again
|
||||
angle = base + 120.0 - w;
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(angle, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(angle + w, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void configureNeon1995TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureNeon1995TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
s->setTriggerSynchronizationGap(0.8227);
|
||||
|
@ -402,54 +402,54 @@ void configureNeon1995TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
s->initialState[T_PRIMARY] = 1;
|
||||
|
||||
s->addEvent2(base - 720 + 600, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base - 720 + 604, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base - 720 + 616, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base - 720 + 620, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base - 720 + 643, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base - 720 + 648, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base - 720 + 671, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base - 720 + 676, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base - 720 + 600, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base - 720 + 604, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base - 720 + 616, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base - 720 + 620, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base - 720 + 643, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base - 720 + 648, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base - 720 + 671, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base - 720 + 676, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(base + 0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(base + 20, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 60, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 75, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 79, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 101, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 106, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 130, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 135, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 20, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 60, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 75, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 79, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 101, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 106, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 130, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 135, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(base + 200, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER); // width = 150
|
||||
s->addEvent2(base + 200, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX); // width = 150
|
||||
|
||||
s->addEvent2(base + 236, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 239, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 250, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 255, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 277, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 282, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 305, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 310, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 236, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 239, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 250, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 255, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 277, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 282, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 305, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 310, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(base + 374, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 374, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(base + 395, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER); // width =
|
||||
s->addEvent2(base + 395, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX); // width =
|
||||
|
||||
s->addEvent2(base + 418, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 436, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 441, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 463, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 468, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 492, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 497, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + 418, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 436, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 441, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 463, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 468, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 492, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + 497, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(base + 560, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER); // width =
|
||||
s->addEvent2(base + 560, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX); // width =
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
void initJeep18_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initJeep18_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
s->isSynchronizationNeeded = true;
|
||||
s->setTriggerSynchronizationGap(1);
|
||||
|
@ -458,63 +458,63 @@ void initJeep18_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
float off = 212;
|
||||
|
||||
s->addEvent2(534 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(536 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(554 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(556 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(574 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(576 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(594 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(596 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(534 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(536 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(554 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(556 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(574 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(576 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(594 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(596 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(654 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(656 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(674 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(676 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(694 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(696 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(714 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(716 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(654 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(656 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(674 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(676 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(694 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(696 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(714 - 720 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(716 - 720 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
s->addEvent2(54 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(56 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(74 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(76 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(94 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(96 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(114 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(116 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(54 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(56 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(74 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(76 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(94 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(96 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(114 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(116 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(148 + off, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER); // 360
|
||||
s->addEvent2(148 + off, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX); // 360
|
||||
|
||||
s->addEvent2(174 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(176 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(194 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(196 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(214 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(216 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(234 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(236 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(174 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(176 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(194 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(196 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(214 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(216 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(234 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(236 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(294 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(296 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(314 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(316 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(334 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(336 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(354 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(356 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(294 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(296 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(314 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(316 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(334 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(336 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(354 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(356 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(414 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(416 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(434 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(436 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(454 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(456 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(474 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(476 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(414 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(416 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(434 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(436 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(454 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(456 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(474 + off, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(476 + off, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(508 + off, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER); // 720
|
||||
s->addEvent2(508 + off, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX); // 720
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "trigger_gm.h"
|
||||
|
||||
void configureGmTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureGmTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
|
||||
|
||||
// all angles are x2 here - so, 5 degree width is 10
|
||||
|
@ -15,26 +15,26 @@ void configureGmTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
float m = 2.0;
|
||||
|
||||
s->addEvent2(m * 60 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 60, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 60 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 60, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(m * 120 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 120.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 120 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 120.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(m * 180 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 180, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 180 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 180, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(m * 240 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 240.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 240 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 240.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(m * 300 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 300.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 300 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 300.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(m * 350 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 350.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 350 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 350.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(m * 360 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 360.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(m * 360 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(m * 360.0, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->setTriggerSynchronizationGap(6);
|
||||
}
|
||||
|
@ -45,61 +45,61 @@ void configureGmTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
* http://www.ls2.com/forums/showthread.php/834483-LS-Timing-Reluctor-Wheels-Explained
|
||||
*
|
||||
*/
|
||||
void initGmLS24(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initGmLS24(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
|
||||
trigger_wheel_e ch = T_PRIMARY;
|
||||
|
||||
/**
|
||||
* based on http://rusefi.com/forum/viewtopic.php?f=3&t=936&start=30 logs
|
||||
*/
|
||||
s->addEvent2(22.2733333333334, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(27.59333333333338, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(51.18333333333338, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(57.58333333333338, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(81.17333333333337, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(87.61333333333339, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(111.30666666666671, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(117.81000000000004, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(141.50000000000006, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(148.05666666666673, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(153.41333333333338, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(178.29333333333338, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(183.51000000000005, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(208.3266666666667, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(213.50000000000006, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(238.26000000000005, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(243.51000000000005, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(268.27000000000004, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(273.53666666666675, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(298.35, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(321.86333333333334, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(328.4966666666667, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(333.81000000000006, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(358.66, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(363.8633333333334, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(388.7033333333334, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(393.88000000000005, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(418.62000000000006, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(441.9566666666667, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(448.6700000000001, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(472.1000000000001, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(478.9333333333334, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(484.08000000000004, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(509.1333333333334, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(514.2666666666667, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(539.1733333333334, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(562.5166666666668, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(569.1133333333333, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(592.5400000000001, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(599.1433333333334, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(622.6300000000001, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(629.2633333333334, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(634.6, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(659.5, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(683.1133333333333, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(689.77, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(695.0666666666667, ch, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720.0, ch, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(22.2733333333334, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(27.59333333333338, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(51.18333333333338, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(57.58333333333338, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(81.17333333333337, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(87.61333333333339, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(111.30666666666671, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(117.81000000000004, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(141.50000000000006, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(148.05666666666673, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(153.41333333333338, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(178.29333333333338, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(183.51000000000005, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(208.3266666666667, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(213.50000000000006, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(238.26000000000005, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(243.51000000000005, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(268.27000000000004, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(273.53666666666675, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(298.35, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(321.86333333333334, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(328.4966666666667, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(333.81000000000006, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(358.66, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(363.8633333333334, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(388.7033333333334, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(393.88000000000005, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(418.62000000000006, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(441.9566666666667, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(448.6700000000001, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(472.1000000000001, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(478.9333333333334, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(484.08000000000004, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(509.1333333333334, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(514.2666666666667, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(539.1733333333334, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(562.5166666666668, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(569.1133333333333, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(592.5400000000001, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(599.1433333333334, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(622.6300000000001, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(629.2633333333334, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(634.6, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(659.5, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(683.1133333333333, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(689.77, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(695.0666666666667, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720.0, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
|
||||
|
|
|
@ -10,21 +10,21 @@
|
|||
|
||||
#define S24 (720.0f / 24 / 2)
|
||||
|
||||
static float addAccordPair(TriggerShape *s, float sb, trigger_wheel_e const waveIndex DECLARE_ENGINE_PARAMETER_S) {
|
||||
s->addEvent2(sb, waveIndex, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
static float addAccordPair(TriggerShape *s, float sb, trigger_wheel_e const waveIndex DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->addEvent2(sb, waveIndex, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb += S24;
|
||||
s->addEvent2(sb, waveIndex, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(sb, waveIndex, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb += S24;
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
#define DIP 7.5f
|
||||
static float addAccordPair3(TriggerShape *s, float sb DECLARE_ENGINE_PARAMETER_S) {
|
||||
static float addAccordPair3(TriggerShape *s, float sb DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
sb += DIP;
|
||||
s->addEvent2(sb, T_CHANNEL_3, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(sb, T_CHANNEL_3, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb += DIP;
|
||||
s->addEvent2(sb, T_CHANNEL_3, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(sb, T_CHANNEL_3, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb += 2 * DIP;
|
||||
return sb;
|
||||
}
|
||||
|
@ -33,65 +33,65 @@ static float addAccordPair3(TriggerShape *s, float sb DECLARE_ENGINE_PARAMETER_S
|
|||
* Thank you Dip!
|
||||
* http://forum.pgmfi.org/viewtopic.php?f=2&t=15570start=210#p139007
|
||||
*/
|
||||
void configureHondaAccordCDDip(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureHondaAccordCDDip(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
s->initialState[T_SECONDARY] = TV_RISE;
|
||||
float sb = 0;
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(90, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(90, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = 90;
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(180, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(180, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = 180;
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(270, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(270, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = 270;
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
s->addEvent2(360.0f - DIP, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360.0f - DIP, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(360, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = 360;
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(450, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(450, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = 450;
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(540, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(540, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = 540;
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(630, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(630, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = 630;
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(720.0f - DIP, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720.0f - DIP, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// s->addEvent2(720.0f - 12 * sb, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
// s->addEvent2(720.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
// s->addEvent2(720.0f - 12 * sb, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// s->addEvent2(720.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(720.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
|
@ -105,7 +105,7 @@ void configureHondaAccordCDDip(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
|
||||
trigger_wheel_e const oneEventWave,
|
||||
trigger_wheel_e const fourEventWave,
|
||||
float prefix DECLARE_ENGINE_PARAMETER_S) {
|
||||
float prefix DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
|
||||
|
@ -115,64 +115,64 @@ void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFo
|
|||
|
||||
s->isSynchronizationNeeded = false;
|
||||
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
if (withOneEventSignal)
|
||||
s->addEvent2(sb - S24 / 2, oneEventWave, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(sb - S24 / 2, oneEventWave, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (withOneEventSignal)
|
||||
s->addEvent2(sb - S24 / 2, oneEventWave, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(sb - S24 / 2, oneEventWave, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (withFourEventSignal) {
|
||||
s->addEvent2(1 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(1 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (withFourEventSignal) {
|
||||
s->addEvent2(1 * 180.0f + prefix, fourEventWave, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(1 * 180.0f + prefix, fourEventWave, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb,T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb,T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
if (withFourEventSignal) {
|
||||
s->addEvent2(2 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(2 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (withFourEventSignal) {
|
||||
s->addEvent2(2 * 180.0f + prefix, fourEventWave, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(2 * 180.0f + prefix, fourEventWave, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
for (int i = 3; i <= 4; i++) {
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
if (withFourEventSignal) {
|
||||
s->addEvent2(i * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(i * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (withFourEventSignal) {
|
||||
s->addEvent2(i * 180.0f + prefix, fourEventWave, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(i * 180.0f + prefix, fourEventWave, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
void configureHondaCbr600(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureHondaCbr600(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
// todo: finish this
|
||||
setToothedWheelConfiguration(s, 24, 0, FOUR_STROKE_CRANK_SENSOR PASS_ENGINE_PARAMETER);
|
||||
setToothedWheelConfiguration(s, 24, 0, FOUR_STROKE_CRANK_SENSOR PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
}
|
||||
|
||||
void configureHondaCbr600custom(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureHondaCbr600custom(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
|
||||
float w = 720 / 2 / 24;
|
||||
// s->initialize(FOUR_STROKE_CAM_SENSOR, false);
|
||||
|
@ -186,89 +186,89 @@ void configureHondaCbr600custom(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
float a = 0;
|
||||
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
s->addEvent2(a - 1, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER); // 30
|
||||
s->addEvent2(a - 1, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX); // 30
|
||||
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(52.4, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(52.4, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
s->addEvent2(a - 1, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER); // 60
|
||||
s->addEvent2(a - 1, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX); // 60
|
||||
|
||||
for (int i = 0;i<10;i++) {
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(381.34f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(381.34f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
a += w;
|
||||
s->addEvent2(a - 1, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a - 1, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
for (int i = 0;i<1;i++) {
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
s->addEvent2(449.1f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(449.1f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
for (int i = 0;i<8;i++) {
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
a += w;
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += w;
|
||||
s->addEvent2(a - 1, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a - 1, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
s->addEvent2(720.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
}
|
||||
|
||||
void configureHondaAccordShifted(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureHondaAccordShifted(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
float w = 720 / 2 / 24;
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
float sb = S24;
|
||||
|
||||
// like this there is no issue
|
||||
// s->addEvent2(S24 + 0.001, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
// s->addEvent2(S24 + 0.1, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
// s->addEvent2(S24 + 0.001, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// s->addEvent2(S24 + 0.1, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(S24 + 0.001, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(S24 + 0.1, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(S24 + 0.001, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(S24 + 0.1, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
|
||||
sb += S24;
|
||||
s->addEvent2(sb, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(sb, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
sb += S24;
|
||||
|
||||
s->addEvent2(S24 + 22, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(S24 + 22, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
for (int i = 0;i<23;i++) {
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER);
|
||||
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
|
||||
|
@ -277,19 +277,19 @@ void configureHondaAccordShifted(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
s->isSynchronizationNeeded = false;
|
||||
}
|
||||
|
||||
void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
int totalTeethCount = 16;
|
||||
int skippedCount = 0;
|
||||
|
||||
s->addEvent2(2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 2, 20 PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(20, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 20, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 2, 20 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(20, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 20, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 360, 360, NO_LEFT_FILTER,
|
||||
NO_RIGHT_FILTER PASS_ENGINE_PARAMETER);
|
||||
NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "trigger_mazda.h"
|
||||
|
||||
void initializeMazdaMiataNaShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initializeMazdaMiataNaShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
s->setTriggerSynchronizationGap2(1.4930 * 0.6f, 1.4930 * 1.3f);
|
||||
s->useRiseEdge = false;
|
||||
|
@ -32,26 +32,26 @@ void initializeMazdaMiataNaShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
/**
|
||||
* http://rusefi.com/forum/viewtopic.php?f=3&t=729&p=12983#p12983
|
||||
*/
|
||||
s->addEvent2(52.960405, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(122.635956, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(52.960405, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(122.635956, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(216.897031, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(232.640068, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(288.819688, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(302.646323, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(216.897031, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(232.640068, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(288.819688, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(302.646323, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(412.448056, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(482.816719, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(412.448056, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(482.816719, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(577.035495, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(592.878113, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(662.899708, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(577.035495, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(592.878113, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(662.899708, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
// TT_MIATA_VVT
|
||||
void initializeMazdaMiataNb2Crank(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initializeMazdaMiataNb2Crank(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR, false);
|
||||
|
||||
float o = 160;
|
||||
|
@ -59,13 +59,13 @@ void initializeMazdaMiataNb2Crank(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
s->tdcPosition = 60 + 655;
|
||||
|
||||
s->setTriggerSynchronizationGap2(0.35f, 0.98f);
|
||||
s->addEvent2(o + 4 * 56.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(o + 4 * 60.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(o + 4 * 136.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(o + 4 * 140.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(o + 4 * 56.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(o + 4 * 60.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(o + 4 * 136.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(o + 4 * 140.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
static void initializeMazdaMiataNb1ShapeWithOffset(TriggerShape *s, float offset DECLARE_ENGINE_PARAMETER_S) {
|
||||
static void initializeMazdaMiataNb1ShapeWithOffset(TriggerShape *s, float offset DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
s->setTriggerSynchronizationGap(0.11f);
|
||||
s->useRiseEdge = false;
|
||||
|
@ -76,45 +76,45 @@ static void initializeMazdaMiataNb1ShapeWithOffset(TriggerShape *s, float offset
|
|||
/**
|
||||
* cam sensor is primary, crank sensor is secondary
|
||||
*/
|
||||
s->addEvent2(20.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(20.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(offset + 66.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 70.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 136.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 140.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 246.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 250.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 316.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 320.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 66.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 70.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 136.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 140.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 246.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 250.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 316.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 320.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(340.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(340.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(360.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(380.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(400.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(380.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(400.0f, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(offset + 426.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 430.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 496.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 500.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 606.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 610.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 676.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 680.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + 426.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 430.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 496.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 500.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 606.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 610.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 676.0f, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + 680.0f, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(720.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720.0f, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
void initializeMazdaMiataNb1Shape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
initializeMazdaMiataNb1ShapeWithOffset(s, 0 PASS_ENGINE_PARAMETER);
|
||||
void initializeMazdaMiataNb1Shape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
initializeMazdaMiataNb1ShapeWithOffset(s, 0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void initializeMazdaMiataVVtTestShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
initializeMazdaMiataNb1ShapeWithOffset(s, -22 PASS_ENGINE_PARAMETER);
|
||||
void initializeMazdaMiataVVtTestShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
initializeMazdaMiataNb1ShapeWithOffset(s, -22 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void configureMazdaProtegeSOHC(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureMazdaProtegeSOHC(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
|
||||
// todo: move to into configuration definition s->needSecondTriggerInput = FALSE;
|
||||
|
||||
|
@ -126,23 +126,23 @@ void configureMazdaProtegeSOHC(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
float z = 0.093;
|
||||
a = 180;
|
||||
s->addEvent2(a - z * 720, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a - z * 720, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(a, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
a += 180;
|
||||
s->addEvent2(a - z * 720, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a - z * 720, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(a, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += 180;
|
||||
s->addEvent2(a - z * 720, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a - z * 720, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(a, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
a += 180;
|
||||
s->addEvent2(a - z * 720, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a - z * 720, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(a, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
}
|
||||
|
||||
void configureMazdaProtegeLx(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureMazdaProtegeLx(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
// todo: move to into configuration definition s->needSecondTriggerInput = FALSE;
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
|
@ -150,21 +150,21 @@ void configureMazdaProtegeLx(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
/**
|
||||
* based on https://svn.code.sf.net/p/rusefi/code/trunk/misc/logs/1993_escort_gt/MAIN_rfi_report_2015-02-01%2017_39.csv
|
||||
*/
|
||||
s->addEvent2(95.329254, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95.329254, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(95.329254 + 14.876692, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95.329254 + 82.693557, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95.329254 + 14.876692, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(95.329254 + 82.693557, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(95.329254 + 137.119154, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95.329254 + 137.119154, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(95.329254 + 192.378308, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95.329254 + 261.556418, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95.329254 + 192.378308, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(95.329254 + 261.556418, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(95.329254 + 373.060597, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95.329254 + 443.503184, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95.329254 + 373.060597, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(95.329254 + 443.503184, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(95.329254 + 555.349776, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(95.329254 + 555.349776, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->tdcPosition = 137.119154;
|
||||
s->isSynchronizationNeeded = false;
|
||||
|
|
|
@ -7,31 +7,31 @@
|
|||
|
||||
#include "trigger_mitsubishi.h"
|
||||
|
||||
void configureFordAspireTriggerShape(TriggerShape * s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureFordAspireTriggerShape(TriggerShape * s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
s->isSynchronizationNeeded = false;
|
||||
|
||||
float x = 121.90;
|
||||
float y = 110.86;
|
||||
|
||||
s->addEvent2(x + y - 180, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(x, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(x + y, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(x + 180, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(x + y - 180, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(x, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(x + y, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(x + 180, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(x + 180 + y, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(x + 360, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(x + 360 + y, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(x + 540, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(x + 180 + y, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(x + 360, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(x + 360 + y, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(x + 540, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* TT_MITSUBISHI = 11
|
||||
*/
|
||||
void initializeMitsubishi4g18(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initializeMitsubishi4g18(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
s->useRiseEdge = false;
|
||||
|
||||
|
@ -39,17 +39,17 @@ void initializeMitsubishi4g18(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
int secondaryWidth = 70;
|
||||
|
||||
s->addEvent2(106.77999999999997, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(120.09999999999998, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(188.0775, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(286.33, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(298.875, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(354.91999999999996, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(366.6825, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(476.45, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(543.9749999999999, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(639.52, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(653.15, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720.0, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(106.77999999999997, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(120.09999999999998, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(188.0775, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(286.33, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(298.875, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(354.91999999999996, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(366.6825, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(476.45, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(543.9749999999999, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(639.52, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(653.15, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720.0, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "trigger_nissan.h"
|
||||
#include "trigger_universal.h"
|
||||
|
||||
static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd DECLARE_ENGINE_PARAMETER_S) {
|
||||
static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, with2nd);
|
||||
s->isSynchronizationNeeded = true;
|
||||
s->gapBothDirections = true;
|
||||
|
@ -29,18 +29,18 @@ static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd
|
|||
|
||||
if (with2nd) {
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720,
|
||||
left, right PASS_ENGINE_PARAMETER);
|
||||
left, right PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
s->addEvent2(right, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(right, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
left = right;
|
||||
right = base;
|
||||
if (with2nd) {
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720,
|
||||
left, right PASS_ENGINE_PARAMETER);
|
||||
left, right PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
s->addEvent2(right, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(right, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// was is the the one with 360 opto sensor?
|
||||
|
||||
|
@ -50,43 +50,43 @@ static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd
|
|||
right = base - w;
|
||||
if (with2nd) {
|
||||
// addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720,
|
||||
// left, right PASS_ENGINE_PARAMETER);
|
||||
// left, right PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
s->addEvent2(right, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(right, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
left = right;
|
||||
right = base;
|
||||
if (with2nd) {
|
||||
// addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720,
|
||||
// left, right PASS_ENGINE_PARAMETER);
|
||||
// left, right PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
s->addEvent2(right, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(right, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
base += 180;
|
||||
left = right;
|
||||
right = base - w;
|
||||
if (with2nd) {
|
||||
// addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720,
|
||||
// left, right PASS_ENGINE_PARAMETER);
|
||||
// left, right PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
s->addEvent2(right, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(right, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
left = right;
|
||||
right = base;
|
||||
if (with2nd) {
|
||||
// addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720,
|
||||
// left, right PASS_ENGINE_PARAMETER);
|
||||
// left, right PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
s->addEvent2(right, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(right, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
base += 180;
|
||||
left = right;
|
||||
right = base - w;
|
||||
|
||||
s->addEvent2(right, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(right, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
left = right;
|
||||
right = base;
|
||||
s->addEvent2(right, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(right, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,10 +94,10 @@ static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd
|
|||
* Nissan Primera p11 year 1995-2002
|
||||
*/
|
||||
|
||||
void initializeNissanSR20VE_4(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
initializeNissanSR20VE_4_optional_360(s, false PASS_ENGINE_PARAMETER);
|
||||
void initializeNissanSR20VE_4(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
initializeNissanSR20VE_4_optional_360(s, false PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void initializeNissanSR20VE_4_360(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
initializeNissanSR20VE_4_optional_360(s, true PASS_ENGINE_PARAMETER);
|
||||
void initializeNissanSR20VE_4_360(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
initializeNissanSR20VE_4_optional_360(s, true PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
/**
|
||||
* https://en.wikipedia.org/wiki/Rover_K-series_engine
|
||||
*/
|
||||
void initializeRoverK(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initializeRoverK(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
|
||||
|
||||
float tooth = 20;
|
||||
|
@ -23,32 +23,32 @@ void initializeRoverK(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
float base = 0;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
base += tooth;
|
||||
}
|
||||
base += tooth;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
base += tooth;
|
||||
}
|
||||
base += tooth;
|
||||
for (int i = 0; i < 14; i++) {
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
base += tooth;
|
||||
}
|
||||
base += tooth;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
base += tooth;
|
||||
}
|
||||
base += tooth;
|
||||
for (int i = 0; i < 11; i++) {
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + tooth / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + tooth, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
base += tooth;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
/**
|
||||
* This trigger is also used by Nissan and Mazda
|
||||
*/
|
||||
void initialize36_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initialize36_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
float wide = 30 * 2;
|
||||
|
@ -23,89 +23,89 @@ void initialize36_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
float base = 0;
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
s->addEvent2(base + narrow / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + narrow, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + narrow / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + narrow, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
base += narrow;
|
||||
}
|
||||
|
||||
s->addEvent2(base + wide / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + wide, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + wide / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + wide, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
base += wide;
|
||||
|
||||
for (int i = 0; i < 15; i++) {
|
||||
s->addEvent2(base + narrow / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + narrow, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(base + narrow / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(base + narrow, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
base += narrow;
|
||||
}
|
||||
|
||||
s->addEvent2(720 - wide - wide / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720 - wide, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720 - wide - wide / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720 - wide, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(720 - wide / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720 - wide / 2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
void initializeSubaru7_6(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initializeSubaru7_6(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
float magic = 333;
|
||||
|
||||
float width = 5;
|
||||
|
||||
s->addEvent2(25 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(25, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(25 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(25, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(magic - 180 - 87 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 180 - 87, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 180 - 87 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic - 180 - 87, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
s->addEvent2(magic - 180 - 55 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 180 - 55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 180 - 55 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic - 180 - 55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(magic - 180 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 180, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 180 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic - 180, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(182 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(182, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(182 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(182, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(magic - 87 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 87, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 55 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic - 87 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic - 87, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic - 55 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic - 55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
s->addEvent2(343 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(343, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(343 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(343, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(366 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(366, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(366 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(366, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(384 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(384, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(384 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(384, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(magic + 180 - 87 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 180 - 87, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 180 - 55 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 180 - 55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 180 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 180, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 180 - 87 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 180 - 87, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 180 - 55 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 180 - 55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 180 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 180, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
s->addEvent2(538 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(538, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(538 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(538, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(magic + 360 - 87 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 360 - 87, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 360 - 55 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 360 - 55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 360 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 360, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(magic + 360 - 87 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 360 - 87, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 360 - 55 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 360 - 55, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 360 - width, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(magic + 360, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(720 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720 - width, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->setTriggerSynchronizationGap2(4.9, 9);
|
||||
s->setSecondTriggerSynchronizationGap2(0.6, 1.25);
|
||||
|
|
|
@ -11,42 +11,42 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void initialize2jzGE1_12(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void initialize2jzGE1_12(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
float crankD = 360 / 12 / 2; // 15
|
||||
|
||||
float crankAngle = 10;
|
||||
s->addEvent2(crankAngle, T_SECONDARY, TV_FALL, -1, 721 PASS_ENGINE_PARAMETER); // 120
|
||||
s->addEvent2(crankAngle, T_SECONDARY, TV_FALL, -1, 721 PASS_ENGINE_PARAMETER_SUFFIX); // 120
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721 PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
crankAngle += crankD;
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721 PASS_ENGINE_PARAMETER); // 120
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721 PASS_ENGINE_PARAMETER_SUFFIX); // 120
|
||||
crankAngle += crankD;
|
||||
}
|
||||
|
||||
|
||||
s->addEvent2(75, T_PRIMARY, TV_FALL, -1, 721 PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(75, T_PRIMARY, TV_FALL, -1, 721 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
for (int i = 0; i < 21; i++) {
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721 PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
crankAngle += crankD;
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721 PASS_ENGINE_PARAMETER); // 120
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721 PASS_ENGINE_PARAMETER_SUFFIX); // 120
|
||||
crankAngle += crankD;
|
||||
}
|
||||
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721 PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
crankAngle += crankD;
|
||||
|
||||
|
||||
s->addEvent2(720, T_PRIMARY, TV_RISE, -1, 721 PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_PRIMARY, TV_RISE, -1, 721 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
}
|
||||
|
||||
void initialize2jzGE3_34(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
setToothedWheelConfiguration(s, 36, 2, FOUR_STROKE_CRANK_SENSOR PASS_ENGINE_PARAMETER);
|
||||
void initialize2jzGE3_34(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
setToothedWheelConfiguration(s, 36, 2, FOUR_STROKE_CRANK_SENSOR PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
//
|
||||
|
|
|
@ -12,24 +12,24 @@ angle_t getEngineCycle(operation_mode_e operationMode) {
|
|||
}
|
||||
|
||||
void addSkippedToothTriggerEvents(trigger_wheel_e wheel, TriggerShape *s, int totalTeethCount, int skippedCount,
|
||||
float toothWidth, float offset, float engineCycle, float filterLeft, float filterRight DECLARE_ENGINE_PARAMETER_S) {
|
||||
float toothWidth, float offset, float engineCycle, float filterLeft, float filterRight DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
efiAssertVoid(totalTeethCount > 0, "total count");
|
||||
efiAssertVoid(skippedCount >= 0, "skipped count");
|
||||
|
||||
for (int i = 0; i < totalTeethCount - skippedCount - 1; i++) {
|
||||
float angleDown = engineCycle / totalTeethCount * (i + (1 - toothWidth));
|
||||
float angleUp = engineCycle / totalTeethCount * (i + 1);
|
||||
s->addEvent2(offset + angleDown, wheel, TV_RISE, filterLeft, filterRight PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + angleUp, wheel, TV_FALL, filterLeft, filterRight PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + angleDown, wheel, TV_RISE, filterLeft, filterRight PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + angleUp, wheel, TV_FALL, filterLeft, filterRight PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
float angleDown = engineCycle / totalTeethCount * (totalTeethCount - skippedCount - 1 + (1 - toothWidth));
|
||||
s->addEvent2(offset + angleDown, wheel, TV_RISE, filterLeft, filterRight PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + engineCycle, wheel, TV_FALL, filterLeft, filterRight PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(offset + angleDown, wheel, TV_RISE, filterLeft, filterRight PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(offset + engineCycle, wheel, TV_FALL, filterLeft, filterRight PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount,
|
||||
operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S) {
|
||||
operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (totalTeethCount <= 0) {
|
||||
warning(CUSTOM_OBD_TRIGGER_SHAPE, "totalTeethCount is zero or less: %d", totalTeethCount);
|
||||
s->shapeDefinitionError = true;
|
||||
|
@ -42,6 +42,6 @@ void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount,
|
|||
s->isSynchronizationNeeded = (totalTeethCount > 2) && (skippedCount != 0);
|
||||
|
||||
addSkippedToothTriggerEvents(T_PRIMARY, s, totalTeethCount, skippedCount, 0.5, 0, getEngineCycle(operationMode),
|
||||
NO_LEFT_FILTER, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER);
|
||||
NO_LEFT_FILTER, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ static void endSimultaniousInjection(InjectionEvent *event) {
|
|||
for (int i = 0; i < engine->engineConfiguration->specs.cylindersCount; i++) {
|
||||
enginePins.injectors[i].setLow();
|
||||
}
|
||||
engine->injectionEvents.addFuelEventsForCylinder(event->ownIndex PASS_ENGINE_PARAMETER);
|
||||
engine->injectionEvents.addFuelEventsForCylinder(event->ownIndex PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
static void tempTurnPinHigh(InjectorOutputPin *output) {
|
||||
|
@ -194,7 +194,7 @@ void seTurnPinLow(OutputSignalPair *pair) {
|
|||
Engine *engine = pair->event->engine;
|
||||
EXPAND_Engine;
|
||||
#endif
|
||||
engine->injectionEvents.addFuelEventsForCylinder(pair->event->ownIndex PASS_ENGINE_PARAMETER);
|
||||
engine->injectionEvents.addFuelEventsForCylinder(pair->event->ownIndex PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
static void seScheduleByTime(scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, OutputSignalPair *pair) {
|
||||
|
@ -210,7 +210,7 @@ static void seScheduleByTime(scheduling_s *scheduling, efitimeus_t time, schfunc
|
|||
scheduleByTime(scheduling, time, callback, pair);
|
||||
}
|
||||
|
||||
static void scheduleFuelInjection(OutputSignalPair *pair, efitimeus_t nowUs, floatus_t delayUs, floatus_t durationUs, InjectionEvent *event DECLARE_ENGINE_PARAMETER_S) {
|
||||
static void scheduleFuelInjection(OutputSignalPair *pair, efitimeus_t nowUs, floatus_t delayUs, floatus_t durationUs, InjectionEvent *event DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (durationUs < 0) {
|
||||
warning(CUSTOM_NEGATIVE_DURATION, "duration cannot be negative: %d", durationUs);
|
||||
return;
|
||||
|
@ -255,14 +255,14 @@ static void scheduleFuelInjection(OutputSignalPair *pair, efitimeus_t nowUs, flo
|
|||
}
|
||||
|
||||
static ALWAYS_INLINE void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event,
|
||||
int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
|
||||
/**
|
||||
* todo: this is a bit tricky with batched injection. is it? Does the same
|
||||
* wetting coefficient works the same way for any injection mode, or is something
|
||||
* x2 or /2?
|
||||
*/
|
||||
const floatms_t injectionDuration = ENGINE(wallFuel).adjust(event->outputs[0]->injectorIndex, ENGINE(fuelMs) PASS_ENGINE_PARAMETER);
|
||||
const floatms_t injectionDuration = ENGINE(wallFuel).adjust(event->outputs[0]->injectorIndex, ENGINE(fuelMs) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#if EFI_PRINTF_FUEL_DETAILS || defined(__DOXYGEN__)
|
||||
printf("fuel fuelMs=%f adjusted=%f\t\n", ENGINE(fuelMs), injectionDuration);
|
||||
#endif /*EFI_PRINTF_FUEL_DETAILS */
|
||||
|
@ -271,9 +271,9 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int injEventIndex, InjectionE
|
|||
* todo: pre-calculate 'numberOfInjections'
|
||||
* see also injectorDutyCycle
|
||||
*/
|
||||
if (!isCrankingR(rpm) && injectionDuration * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER) > getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER)) {
|
||||
if (!isCrankingR(rpm) && injectionDuration * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX) > getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX)) {
|
||||
warning(CUSTOM_TOO_LONG_FUEL_INJECTION, "Too long fuel injection %fms", injectionDuration);
|
||||
} else if (isCrankingR(rpm) && injectionDuration * getNumberOfInjections(engineConfiguration->crankingInjectionMode PASS_ENGINE_PARAMETER) > getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER)) {
|
||||
} else if (isCrankingR(rpm) && injectionDuration * getNumberOfInjections(engineConfiguration->crankingInjectionMode PASS_ENGINE_PARAMETER_SUFFIX) > getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX)) {
|
||||
warning(CUSTOM_TOO_LONG_CRANKING_FUEL_INJECTION, "Too long cranking fuel injection %fms", injectionDuration);
|
||||
}
|
||||
|
||||
|
@ -335,15 +335,15 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int injEventIndex, InjectionE
|
|||
prevOutputName = outputName;
|
||||
}
|
||||
|
||||
scheduleFuelInjection(pair, getTimeNowUs(), injectionStartDelayUs, MS2US(injectionDuration), event PASS_ENGINE_PARAMETER);
|
||||
scheduleFuelInjection(pair, getTimeNowUs(), injectionStartDelayUs, MS2US(injectionDuration), event PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
|
||||
static void fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static void fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
#if ! EFI_UNIT_TEST
|
||||
if (ENGINE(rpmCalculator.rpmValue) < CONFIG(fuelClosedLoopRpmThreshold) ||
|
||||
ENGINE(sensors.clt) < CONFIG(fuelClosedLoopCltThreshold) ||
|
||||
getTPS(PASS_ENGINE_PARAMETER_F) > CONFIG(fuelClosedLoopTpsThreshold) ||
|
||||
getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) > CONFIG(fuelClosedLoopTpsThreshold) ||
|
||||
ENGINE(sensors.currentAfr) < engineConfiguration->fuelClosedLoopAfrLowThreshold ||
|
||||
ENGINE(sensors.currentAfr) > engineConfiguration->fuelClosedLoopAfrHighThreshold) {
|
||||
engine->engineState.fuelPidCorrection = 0;
|
||||
|
@ -361,7 +361,7 @@ static void fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
|
||||
|
||||
static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIndex, int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIndex, int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#3");
|
||||
efiAssertVoid(trgEventIndex < engine->engineCycleEventCount, "handleFuel/event index");
|
||||
|
||||
|
@ -379,17 +379,17 @@ static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIn
|
|||
*/
|
||||
FuelSchedule *fs = &engine->injectionEvents;
|
||||
if (!fs->isReady) {
|
||||
fs->addFuelEvents(PASS_ENGINE_PARAMETER_F);
|
||||
fs->addFuelEvents(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
#if FUEL_MATH_EXTREME_LOGGING || defined(__DOXYGEN__)
|
||||
scheduleMsg(logger, "handleFuel ind=%d %d", trgEventIndex, getRevolutionCounter());
|
||||
#endif /* FUEL_MATH_EXTREME_LOGGING */
|
||||
|
||||
ENGINE(tpsAccelEnrichment.onNewValue(getTPS(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER));
|
||||
ENGINE(engineLoadAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_F));
|
||||
ENGINE(tpsAccelEnrichment.onNewValue(getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
ENGINE(engineLoadAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
ENGINE(fuelMs) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER) * CONFIG(globalFuelCorrection);
|
||||
ENGINE(fuelMs) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX) * CONFIG(globalFuelCorrection);
|
||||
|
||||
for (int injEventIndex = 0; injEventIndex < CONFIG(specs.cylindersCount); injEventIndex++) {
|
||||
InjectionEvent *event = &fs->elements[injEventIndex];
|
||||
|
@ -399,7 +399,7 @@ static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIn
|
|||
if (eventIndex != trgEventIndex) {
|
||||
continue;
|
||||
}
|
||||
handleFuelInjectionEvent(injEventIndex, event, rpm PASS_ENGINE_PARAMETER);
|
||||
handleFuelInjectionEvent(injEventIndex, event, rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,7 @@ uint32_t *cyccnt = (uint32_t*) &DWT->CYCCNT;
|
|||
* This is the main trigger event handler.
|
||||
* Both injection and ignition are controlled from this method.
|
||||
*/
|
||||
void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex DECLARE_ENGINE_PARAMETER_S) {
|
||||
void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
(void) ckpSignalType;
|
||||
|
||||
ENGINE(m.beforeMainTrigger) = GET_TIMESTAMP();
|
||||
|
@ -482,13 +482,13 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex D
|
|||
engine->ignitionEvents.isReady = false; // we need to rebuild ignition schedule
|
||||
engine->injectionEvents.isReady = false;
|
||||
// todo: move 'triggerIndexByAngle' change into trigger initialization, why is it invoked from here if it's only about trigger shape & optimization?
|
||||
prepareOutputSignals(PASS_ENGINE_PARAMETER_F);
|
||||
prepareOutputSignals(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
// we need this to apply new 'triggerIndexByAngle' values
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
if (CONFIG(fuelClosedLoopCorrectionEnabled)) {
|
||||
fuelClosedLoopCorrection(PASS_ENGINE_PARAMETER_F);
|
||||
fuelClosedLoopCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -506,11 +506,11 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex D
|
|||
* For fuel we schedule start of injection based on trigger angle, and then inject for
|
||||
* specified duration of time
|
||||
*/
|
||||
handleFuel(limitedFuel, trgEventIndex, rpm PASS_ENGINE_PARAMETER);
|
||||
handleFuel(limitedFuel, trgEventIndex, rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
/**
|
||||
* For spark we schedule both start of coil charge and actual spark based on trigger angle
|
||||
*/
|
||||
handleSpark(limitedSpark, trgEventIndex, rpm PASS_ENGINE_PARAMETER);
|
||||
handleSpark(limitedSpark, trgEventIndex, rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||
int diff = hal_lld_get_counter_value() - beforeCallback;
|
||||
if (diff > 0)
|
||||
|
@ -536,10 +536,10 @@ static void showTriggerHistogram(void) {
|
|||
|
||||
static void showMainInfo(Engine *engine) {
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
int rpm = engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F);
|
||||
float el = getEngineLoadT(PASS_ENGINE_PARAMETER_F);
|
||||
int rpm = engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
float el = getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
scheduleMsg(logger, "rpm %d engine_load %f", rpm, el);
|
||||
scheduleMsg(logger, "fuel %fms timing %f", getInjectionDuration(rpm PASS_ENGINE_PARAMETER), engine->engineState.timingAdvance);
|
||||
scheduleMsg(logger, "fuel %fms timing %f", getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX), engine->engineState.timingAdvance);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ RpmCalculator::RpmCalculator() {
|
|||
/**
|
||||
* @return true if there was a full shaft revolution within the last second
|
||||
*/
|
||||
bool RpmCalculator::isRunning(DECLARE_ENGINE_PARAMETER_F) {
|
||||
bool RpmCalculator::isRunning(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
efitick_t nowNt = getTimeNowNt();
|
||||
if (engine->stopEngineRequestTimeNt != 0) {
|
||||
if (nowNt
|
||||
|
@ -101,14 +101,14 @@ void RpmCalculator::assignRpmValue(int value) {
|
|||
}
|
||||
}
|
||||
|
||||
void RpmCalculator::setRpmValue(int value DECLARE_ENGINE_PARAMETER_S) {
|
||||
void RpmCalculator::setRpmValue(int value DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
assignRpmValue(value);
|
||||
if (previousRpmValue == 0 && rpmValue > 0) {
|
||||
/**
|
||||
* this would make sure that we have good numbers for first cranking revolution
|
||||
* #275 cranking could be improved
|
||||
*/
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,12 +139,12 @@ float RpmCalculator::getRpmAcceleration() {
|
|||
*/
|
||||
// todo: migrate to float return result or add a float version? this would have with calculations
|
||||
// todo: add a version which does not check time & saves time? need to profile
|
||||
int RpmCalculator::getRpm(DECLARE_ENGINE_PARAMETER_F) {
|
||||
int RpmCalculator::getRpm(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
#if !EFI_PROD_CODE
|
||||
if (mockRpm != MOCK_UNDEFINED)
|
||||
return mockRpm;
|
||||
#endif
|
||||
if (!isRunning(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (!isRunning(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
revolutionCounterSinceStart = 0;
|
||||
if (rpmValue != 0) {
|
||||
rpmValue = 0;
|
||||
|
@ -176,7 +176,7 @@ bool isCranking(void) {
|
|||
* This callback is invoked on interrupt thread.
|
||||
*/
|
||||
void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
|
||||
uint32_t index DECLARE_ENGINE_PARAMETER_S) {
|
||||
uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
RpmCalculator *rpmState = &engine->rpmCalculator;
|
||||
efitick_t nowNt = getTimeNowNt();
|
||||
engine->m.beforeRpmCb = GET_TIMESTAMP();
|
||||
|
@ -188,7 +188,7 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
|
|||
angle_t crankAngle = NAN;
|
||||
int signal = -1;
|
||||
if (ENGINE(sensorChartMode) == SC_TRIGGER) {
|
||||
crankAngle = getCrankshaftAngleNt(nowNt PASS_ENGINE_PARAMETER);
|
||||
crankAngle = getCrankshaftAngleNt(nowNt PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
signal = 1000 * ckpSignalType + index;
|
||||
}
|
||||
#endif
|
||||
|
@ -203,7 +203,7 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
|
|||
}
|
||||
// todo: wrap this with if (index == 0) statement this would make scAddData logic simpler
|
||||
|
||||
bool hadRpmRecently = rpmState->isRunning(PASS_ENGINE_PARAMETER_F);
|
||||
bool hadRpmRecently = rpmState->isRunning(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
if (hadRpmRecently) {
|
||||
efitime_t diffNt = nowNt - rpmState->lastRpmEventTimeNt;
|
||||
|
@ -215,11 +215,11 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
|
|||
*
|
||||
*/
|
||||
if (diffNt == 0) {
|
||||
rpmState->setRpmValue(NOISY_RPM PASS_ENGINE_PARAMETER);
|
||||
rpmState->setRpmValue(NOISY_RPM PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
} else {
|
||||
int mult = (int)getEngineCycle(engineConfiguration->operationMode) / 360;
|
||||
int rpm = (int) (60 * US2NT(US_PER_SECOND_LL) * mult / diffNt);
|
||||
rpmState->setRpmValue(rpm > UNREALISTIC_RPM ? NOISY_RPM : rpm PASS_ENGINE_PARAMETER);
|
||||
rpmState->setRpmValue(rpm > UNREALISTIC_RPM ? NOISY_RPM : rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
rpmState->onNewEngineCycle();
|
||||
|
@ -252,7 +252,7 @@ static void onTdcCallback(void) {
|
|||
* This trigger callback schedules the actual physical TDC callback in relation to trigger synchronization point.
|
||||
*/
|
||||
static void tdcMarkCallback(trigger_event_e ckpSignalType,
|
||||
uint32_t index0 DECLARE_ENGINE_PARAMETER_S) {
|
||||
uint32_t index0 DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
(void) ckpSignalType;
|
||||
bool isTriggerSynchronizationPoint = index0 == 0;
|
||||
if (isTriggerSynchronizationPoint && ENGINE(isEngineChartEnabled)) {
|
||||
|
@ -276,7 +276,7 @@ int getRevolutionCounter() {
|
|||
/**
|
||||
* @return Current crankshaft angle, 0 to 720 for four-stroke
|
||||
*/
|
||||
float getCrankshaftAngleNt(efitime_t timeNt DECLARE_ENGINE_PARAMETER_S) {
|
||||
float getCrankshaftAngleNt(efitime_t timeNt DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
efitime_t timeSinceZeroAngleNt = timeNt
|
||||
- engine->rpmCalculator.lastRpmEventTimeNt;
|
||||
|
||||
|
@ -285,7 +285,7 @@ float getCrankshaftAngleNt(efitime_t timeNt DECLARE_ENGINE_PARAMETER_S) {
|
|||
* compiler is not smart enough to figure out that "A / ( B / C)" could be optimized into
|
||||
* "A * C / B" in order to replace a slower division with a faster multiplication.
|
||||
*/
|
||||
int rpm = engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F);
|
||||
int rpm = engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
return rpm == 0 ? NAN : timeSinceZeroAngleNt / getOneDegreeTimeNt(rpm);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ int isIgnitionTimingError(void) {
|
|||
return ignitionErrorDetection.sum(6) > 4;
|
||||
}
|
||||
|
||||
void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_S);
|
||||
void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
static void turnSparkPinLow2(IgnitionEvent *event, IgnitionOutputPin *output) {
|
||||
#if SPARK_EXTREME_LOGGING || defined(__DOXYGEN__)
|
||||
|
@ -73,7 +73,7 @@ void turnSparkPinLow(IgnitionEvent *event) {
|
|||
EXPAND_Engine;
|
||||
#endif
|
||||
// now that we've just fired a coil let's prepare the new schedule for the next engine revolution
|
||||
prepareIgnitionSchedule(event PASS_ENGINE_PARAMETER);
|
||||
prepareIgnitionSchedule(event PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
static void turnSparkPinHigh2(IgnitionEvent *event, IgnitionOutputPin *output) {
|
||||
|
@ -122,7 +122,7 @@ void turnSparkPinHigh(IgnitionEvent *event) {
|
|||
static int globalSparkIdCoutner = 0;
|
||||
|
||||
static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t trgEventIndex, IgnitionEvent *iEvent,
|
||||
int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
|
||||
const floatms_t dwellMs = ENGINE(engineState.sparkDwell);
|
||||
if (cisnan(dwellMs) || dwellMs <= 0) {
|
||||
|
@ -172,7 +172,7 @@ static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t trgEventI
|
|||
* Spark event is often happening during a later trigger event timeframe
|
||||
* TODO: improve precision
|
||||
*/
|
||||
TRIGGER_SHAPE(findTriggerPosition(&iEvent->sparkPosition, iEvent->advance PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&iEvent->sparkPosition, iEvent->advance PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
#if EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||
printf("spark dwell@ %d/%d spark@ %d/%d id=%d\r\n", iEvent->dwellPosition.eventIndex, (int)iEvent->dwellPosition.angleOffset,
|
||||
|
@ -217,19 +217,19 @@ static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t trgEventI
|
|||
}
|
||||
|
||||
|
||||
void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_S) {
|
||||
void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
// todo: clean up this implementation? does not look too nice as is.
|
||||
|
||||
// change of sign here from 'before TDC' to 'after TDC'
|
||||
const angle_t localAdvance = -ENGINE(engineState.timingAdvance) + ENGINE(angleExtra[event->cylinderIndex]) + CONFIG(timing_offset_cylinder[event->cylinderIndex]);
|
||||
const int index = ENGINE(ignitionPin[event->cylinderIndex]);
|
||||
const int coilIndex = ID2INDEX(getCylinderId(index PASS_ENGINE_PARAMETER));
|
||||
const int coilIndex = ID2INDEX(getCylinderId(index PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
IgnitionOutputPin *output = &enginePins.coils[coilIndex];
|
||||
|
||||
IgnitionOutputPin *secondOutput;
|
||||
if (CONFIG(ignitionMode) == IM_WASTED_SPARK && CONFIG(twoWireBatchIgnition)) {
|
||||
int secondIndex = index + CONFIG(specs.cylindersCount) / 2;
|
||||
int secondCoilIndex = ID2INDEX(getCylinderId(secondIndex PASS_ENGINE_PARAMETER));
|
||||
int secondCoilIndex = ID2INDEX(getCylinderId(secondIndex PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
secondOutput = &enginePins.coils[secondCoilIndex];
|
||||
assertPinAssigned(secondOutput);
|
||||
} else {
|
||||
|
@ -243,7 +243,7 @@ void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_S) {
|
|||
event->outputs[1] = secondOutput;
|
||||
event->advance = localAdvance;
|
||||
|
||||
TRIGGER_SHAPE(findTriggerPosition(&event->dwellPosition, localAdvance - dwellAngle PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&event->dwellPosition, localAdvance - dwellAngle PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
#if FUEL_MATH_EXTREME_LOGGING || defined(__DOXYGEN__)
|
||||
printf("addIgnitionEvent %s ind=%d\n", output->name, event->dwellPosition.eventIndex);
|
||||
|
@ -251,7 +251,7 @@ void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_S) {
|
|||
#endif /* FUEL_MATH_EXTREME_LOGGING */
|
||||
}
|
||||
|
||||
static void initializeIgnitionActions(IgnitionEventList *list DECLARE_ENGINE_PARAMETER_S) {
|
||||
static void initializeIgnitionActions(IgnitionEventList *list DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (cisnan(ENGINE(engineState.timingAdvance))) {
|
||||
// error should already be reported
|
||||
// need to invalidate previous ignition schedule
|
||||
|
@ -265,12 +265,12 @@ static void initializeIgnitionActions(IgnitionEventList *list DECLARE_ENGINE_PAR
|
|||
#if EFI_UNIT_TEST
|
||||
list->elements[cylinderIndex].engine = engine;
|
||||
#endif
|
||||
prepareIgnitionSchedule(&list->elements[cylinderIndex] PASS_ENGINE_PARAMETER);
|
||||
prepareIgnitionSchedule(&list->elements[cylinderIndex] PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
list->isReady = true;
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_F) {
|
||||
static ALWAYS_INLINE void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
||||
engine->m.beforeIgnitionSch = GET_TIMESTAMP();
|
||||
/**
|
||||
|
@ -297,12 +297,12 @@ static ALWAYS_INLINE void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
IgnitionEventList *list = &engine->ignitionEvents;
|
||||
|
||||
initializeIgnitionActions(list PASS_ENGINE_PARAMETER);
|
||||
initializeIgnitionActions(list PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engine->m.ignitionSchTime = GET_TIMESTAMP() - engine->m.beforeIgnitionSch;
|
||||
}
|
||||
|
||||
void handleSpark(bool limitedSpark, uint32_t trgEventIndex, int rpm
|
||||
DECLARE_ENGINE_PARAMETER_S) {
|
||||
DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
|
||||
if (!isValidRpm(rpm) || !CONFIG(isIgnitionEnabled)) {
|
||||
// this might happen for instance in case of a single trigger event after a pause
|
||||
|
@ -310,7 +310,7 @@ void handleSpark(bool limitedSpark, uint32_t trgEventIndex, int rpm
|
|||
}
|
||||
|
||||
if (!engine->ignitionEvents.isReady) {
|
||||
prepareIgnitionSchedule(PASS_ENGINE_PARAMETER_F);
|
||||
prepareIgnitionSchedule(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -344,7 +344,7 @@ void handleSpark(bool limitedSpark, uint32_t trgEventIndex, int rpm
|
|||
IgnitionEvent *event = &engine->ignitionEvents.elements[i];
|
||||
if (event->dwellPosition.eventIndex != trgEventIndex)
|
||||
continue;
|
||||
handleSparkEvent(limitedSpark, trgEventIndex, event, rpm PASS_ENGINE_PARAMETER);
|
||||
handleSparkEvent(limitedSpark, trgEventIndex, event, rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ void initSparkLogic(Logging *sharedLogger) {
|
|||
* Number of sparks per physical coil
|
||||
* @see getNumberOfInjections
|
||||
*/
|
||||
int getNumberOfSparks(ignition_mode_e mode DECLARE_ENGINE_PARAMETER_S) {
|
||||
int getNumberOfSparks(ignition_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
switch (mode) {
|
||||
case IM_ONE_COIL:
|
||||
return engineConfiguration->specs.cylindersCount;
|
||||
|
@ -374,8 +374,8 @@ int getNumberOfSparks(ignition_mode_e mode DECLARE_ENGINE_PARAMETER_S) {
|
|||
/**
|
||||
* @see getInjectorDutyCycle
|
||||
*/
|
||||
percent_t getCoilDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t totalPerCycle = 1/**getInjectionDuration(rpm PASS_ENGINE_PARAMETER)*/ * getNumberOfSparks(engineConfiguration->ignitionMode PASS_ENGINE_PARAMETER);
|
||||
percent_t getCoilDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
floatms_t totalPerCycle = 1/**getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX)*/ * getNumberOfSparks(engineConfiguration->ignitionMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
floatms_t engineCycleDuration = getCrankshaftRevolutionTimeMs(rpm) * (engineConfiguration->operationMode == TWO_STROKE ? 1 : 2);
|
||||
return 100 * totalPerCycle / engineCycleDuration;
|
||||
}
|
||||
|
|
|
@ -42,11 +42,11 @@ static histogram_s triggerCallbackHistogram;
|
|||
|
||||
static Logging *logger;
|
||||
|
||||
efitime_t getCrankEventCounter(DECLARE_ENGINE_PARAMETER_F) {
|
||||
efitime_t getCrankEventCounter(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return engine->triggerCentral.triggerState.getTotalEventCounter();
|
||||
}
|
||||
|
||||
efitime_t getStartOfRevolutionIndex(DECLARE_ENGINE_PARAMETER_F) {
|
||||
efitime_t getStartOfRevolutionIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return engine->triggerCentral.triggerState.getStartOfRevolutionIndex();
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ void hwHandleShaftSignal(trigger_event_e signal) {
|
|||
maxTriggerReentraint = triggerReentraint;
|
||||
triggerReentraint++;
|
||||
efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#8");
|
||||
engine->triggerCentral.handleShaftSignal(signal PASS_ENGINE_PARAMETER);
|
||||
engine->triggerCentral.handleShaftSignal(signal PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
triggerReentraint--;
|
||||
triggerDuration = GET_TIMESTAMP() - triggerHanlderEntryTime;
|
||||
isInsideTriggerHandler = false;
|
||||
|
@ -206,7 +206,7 @@ static char shaft_signal_msg_index[15];
|
|||
static bool isUpEvent[6] = { false, true, false, true, false, true };
|
||||
static const char *eventId[6] = { CRANK1, CRANK1, CRANK2, CRANK2, CRANK3, CRANK3 };
|
||||
|
||||
static ALWAYS_INLINE void reportEventToWaveChart(trigger_event_e ckpSignalType, int index DECLARE_ENGINE_PARAMETER_S) {
|
||||
static ALWAYS_INLINE void reportEventToWaveChart(trigger_event_e ckpSignalType, int index DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
itoa10(&shaft_signal_msg_index[2], index);
|
||||
bool isUp = isUpEvent[(int) ckpSignalType];
|
||||
shaft_signal_msg_index[0] = isUp ? 'u' : 'd';
|
||||
|
@ -219,7 +219,7 @@ static ALWAYS_INLINE void reportEventToWaveChart(trigger_event_e ckpSignalType,
|
|||
}
|
||||
}
|
||||
|
||||
void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PARAMETER_S) {
|
||||
void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
efiAssertVoid(engine!=NULL, "configuration");
|
||||
|
||||
if (triggerShape.shapeDefinitionError) {
|
||||
|
@ -251,7 +251,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PAR
|
|||
/**
|
||||
* This invocation changes the state of triggerState
|
||||
*/
|
||||
triggerState.decodeTriggerEvent(signal, nowNt PASS_ENGINE_PARAMETER);
|
||||
triggerState.decodeTriggerEvent(signal, nowNt PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
/**
|
||||
* If we only have a crank position sensor with four stroke, here we are extending crank revolutions with a 360 degree
|
||||
|
@ -272,14 +272,14 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PAR
|
|||
if (triggerIndexForListeners == 0) {
|
||||
timeAtVirtualZeroNt = nowNt;
|
||||
}
|
||||
reportEventToWaveChart(signal, triggerIndexForListeners PASS_ENGINE_PARAMETER);
|
||||
reportEventToWaveChart(signal, triggerIndexForListeners PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
if (!triggerState.shaft_is_synchronized) {
|
||||
// we should not propagate event if we do not know where we are
|
||||
return;
|
||||
}
|
||||
|
||||
if (triggerState.isValidIndex(PASS_ENGINE_PARAMETER_F)) {
|
||||
if (triggerState.isValidIndex(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
#if TRIGGER_EXTREME_LOGGING || defined(__DOXYGEN__)
|
||||
scheduleMsg(logger, "trigger %d %d %d", triggerIndexForListeners, getRevolutionCounter(), (int)getTimeNowUs());
|
||||
#endif /* FUEL_MATH_EXTREME_LOGGING */
|
||||
|
@ -289,7 +289,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PAR
|
|||
*/
|
||||
for (int i = 0; i < triggerListeneres.currentListenersCount; i++) {
|
||||
ShaftPositionListener listener = (ShaftPositionListener) triggerListeneres.callbacks[i];
|
||||
(listener)(signal, triggerIndexForListeners PASS_ENGINE_PARAMETER);
|
||||
(listener)(signal, triggerIndexForListeners PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ void printAllTriggers() {
|
|||
engineConfiguration->operationMode = FOUR_STROKE_CAM_SENSOR;
|
||||
|
||||
TriggerShape *s = &engine->triggerCentral.triggerShape;
|
||||
s->initializeTriggerShape(NULL PASS_ENGINE_PARAMETER);
|
||||
s->initializeTriggerShape(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
fprintf(fp, "TRIGGERTYPE %d %d %s %f\r\n", triggerId, s->getLength(), getTrigger_type_e(tt), s->tdcPosition);
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ bool isTriggerDecoderError(void) {
|
|||
return errorDetection.sum(6) > 4;
|
||||
}
|
||||
|
||||
bool TriggerState::isValidIndex(DECLARE_ENGINE_PARAMETER_F) {
|
||||
bool TriggerState::isValidIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return currentCycle.current_index < TRIGGER_SHAPE(size);
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ static trigger_value_e eventType[6] = { TV_FALL, TV_RISE, TV_FALL, TV_RISE, TV_F
|
|||
* @param signal type of event which just happened
|
||||
* @param nowNt current time
|
||||
*/
|
||||
void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t nowNt DECLARE_ENGINE_PARAMETER_S) {
|
||||
void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
efiAssertVoid(signal <= SHAFT_3RD_RISING, "unexpected signal");
|
||||
|
||||
trigger_wheel_e triggerWheel = eventIndex[signal];
|
||||
|
@ -384,7 +384,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
|
|||
toothed_previous_duration = currentDuration;
|
||||
toothed_previous_time = nowNt;
|
||||
}
|
||||
if (!isValidIndex(PASS_ENGINE_PARAMETER_F) && !isInitializingTrigger) {
|
||||
if (!isValidIndex(PASS_ENGINE_PARAMETER_SIGNATURE) && !isInitializingTrigger) {
|
||||
// let's not show a warning if we are just starting to spin
|
||||
if (engine->rpmCalculator.rpmValue != 0) {
|
||||
warning(CUSTOM_SYNC_ERROR, "sync error: index #%d above total size %d", currentCycle.current_index, TRIGGER_SHAPE(size));
|
||||
|
@ -427,7 +427,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
|
|||
}
|
||||
}
|
||||
|
||||
void configure3_1_cam(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configure3_1_cam(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
|
||||
|
@ -436,61 +436,61 @@ void configure3_1_cam(TriggerShape *s, operation_mode_e operationMode DECLARE_EN
|
|||
|
||||
trigger_wheel_e crank = T_SECONDARY;
|
||||
|
||||
s->addEvent2(10, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(50, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(10, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(50, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
|
||||
float a = 2 * crankW;
|
||||
|
||||
// #1/3
|
||||
s->addEvent2(a += crankW, crank, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a += crankW, crank, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a += crankW, crank, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(a += crankW, crank, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// #2/3
|
||||
s->addEvent2(a += crankW, crank, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a += crankW, crank, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a += crankW, crank, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(a += crankW, crank, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// #3/3
|
||||
a += crankW;
|
||||
a += crankW;
|
||||
|
||||
// 2nd #1/3
|
||||
s->addEvent2(a += crankW, crank, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a += crankW, crank, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a += crankW, crank, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(a += crankW, crank, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// 2nd #2/3
|
||||
s->addEvent2(a += crankW, crank, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a += crankW, crank, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(a += crankW, crank, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(a += crankW, crank, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
}
|
||||
|
||||
void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
float engineCycle = getEngineCycle(operationMode);
|
||||
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
s->addEvent2(180, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(180, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(360, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(540, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(540, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S) {
|
||||
void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
int totalTeethCount = 60;
|
||||
int skippedCount = 2;
|
||||
|
||||
s->addEvent2(2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 2, 20 PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(20, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 20, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 2, 20 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(20, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 20, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 360, 360, NO_LEFT_FILTER,
|
||||
NO_RIGHT_FILTER PASS_ENGINE_PARAMETER);
|
||||
NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
|
@ -501,7 +501,7 @@ static TriggerState initState CCM_OPTIONAL;
|
|||
/**
|
||||
* External logger is needed because at this point our logger is not yet initialized
|
||||
*/
|
||||
void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMETER_S) {
|
||||
void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
const trigger_config_s *triggerConfig = &engineConfiguration->trigger;
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 256, "init t");
|
||||
|
@ -514,160 +514,160 @@ void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMET
|
|||
|
||||
case TT_TOOTHED_WHEEL:
|
||||
initializeSkippedToothTriggerShapeExt(this, triggerConfig->customTotalToothCount,
|
||||
triggerConfig->customSkippedToothCount, engineConfiguration->operationMode PASS_ENGINE_PARAMETER);
|
||||
triggerConfig->customSkippedToothCount, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_MAZDA_MIATA_NA:
|
||||
initializeMazdaMiataNaShape(this PASS_ENGINE_PARAMETER);
|
||||
initializeMazdaMiataNaShape(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_MAZDA_MIATA_NB1:
|
||||
initializeMazdaMiataNb1Shape(this PASS_ENGINE_PARAMETER);
|
||||
initializeMazdaMiataNb1Shape(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_MAZDA_MIATA_VVT_TEST:
|
||||
initializeMazdaMiataVVtTestShape(this PASS_ENGINE_PARAMETER);
|
||||
initializeMazdaMiataVVtTestShape(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_MIATA_VVT:
|
||||
initializeMazdaMiataNb2Crank(this PASS_ENGINE_PARAMETER);
|
||||
initializeMazdaMiataNb2Crank(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_DODGE_NEON_1995:
|
||||
configureNeon1995TriggerShape(this PASS_ENGINE_PARAMETER);
|
||||
configureNeon1995TriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_DODGE_STRATUS:
|
||||
configureDodgeStratusTriggerShape(this PASS_ENGINE_PARAMETER);
|
||||
configureDodgeStratusTriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_DODGE_NEON_2003_CAM:
|
||||
configureNeon2003TriggerShapeCam(this PASS_ENGINE_PARAMETER);
|
||||
configureNeon2003TriggerShapeCam(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_DODGE_NEON_2003_CRANK:
|
||||
configureNeon2003TriggerShapeCam(this PASS_ENGINE_PARAMETER);
|
||||
// configureNeon2003TriggerShapeCrank(triggerShape PASS_ENGINE_PARAMETER);
|
||||
configureNeon2003TriggerShapeCam(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// configureNeon2003TriggerShapeCrank(triggerShape PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_FORD_ASPIRE:
|
||||
configureFordAspireTriggerShape(this PASS_ENGINE_PARAMETER);
|
||||
configureFordAspireTriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_GM_7X:
|
||||
configureGmTriggerShape(this PASS_ENGINE_PARAMETER);
|
||||
configureGmTriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_MAZDA_DOHC_1_4:
|
||||
configureMazdaProtegeLx(this PASS_ENGINE_PARAMETER);
|
||||
configureMazdaProtegeLx(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_ONE_PLUS_ONE:
|
||||
configureOnePlusOne(this, engineConfiguration->operationMode PASS_ENGINE_PARAMETER);
|
||||
configureOnePlusOne(this, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_3_1_CAM:
|
||||
configure3_1_cam(this, engineConfiguration->operationMode PASS_ENGINE_PARAMETER);
|
||||
configure3_1_cam(this, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_ONE_PLUS_TOOTHED_WHEEL_60_2:
|
||||
configureOnePlus60_2(this, engineConfiguration->operationMode PASS_ENGINE_PARAMETER);
|
||||
configureOnePlus60_2(this, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_ONE:
|
||||
setToothedWheelConfiguration(this, 1, 0, engineConfiguration->operationMode PASS_ENGINE_PARAMETER);
|
||||
setToothedWheelConfiguration(this, 1, 0, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_MAZDA_SOHC_4:
|
||||
configureMazdaProtegeSOHC(this PASS_ENGINE_PARAMETER);
|
||||
configureMazdaProtegeSOHC(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_MINI_COOPER_R50:
|
||||
configureMiniCooperTriggerShape(this PASS_ENGINE_PARAMETER);
|
||||
configureMiniCooperTriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_TOOTHED_WHEEL_60_2:
|
||||
setToothedWheelConfiguration(this, 60, 2, engineConfiguration->operationMode PASS_ENGINE_PARAMETER);
|
||||
setToothedWheelConfiguration(this, 60, 2, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_60_2_VW:
|
||||
setVwConfiguration(this PASS_ENGINE_PARAMETER);
|
||||
setVwConfiguration(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_TOOTHED_WHEEL_36_1:
|
||||
setToothedWheelConfiguration(this, 36, 1, engineConfiguration->operationMode PASS_ENGINE_PARAMETER);
|
||||
setToothedWheelConfiguration(this, 36, 1, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_HONDA_4_24_1:
|
||||
configureHonda_1_4_24(this, true, true, T_CHANNEL_3, T_PRIMARY, 0 PASS_ENGINE_PARAMETER);
|
||||
configureHonda_1_4_24(this, true, true, T_CHANNEL_3, T_PRIMARY, 0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_HONDA_4_24:
|
||||
configureHonda_1_4_24(this, false, true, T_NONE, T_PRIMARY, 0 PASS_ENGINE_PARAMETER);
|
||||
configureHonda_1_4_24(this, false, true, T_NONE, T_PRIMARY, 0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_HONDA_1_24:
|
||||
configureHonda_1_4_24(this, true, false, T_PRIMARY, T_NONE, 10 PASS_ENGINE_PARAMETER);
|
||||
configureHonda_1_4_24(this, true, false, T_PRIMARY, T_NONE, 10 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_HONDA_ACCORD_1_24_SHIFTED:
|
||||
configureHondaAccordShifted(this PASS_ENGINE_PARAMETER);
|
||||
configureHondaAccordShifted(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_HONDA_1_4_24:
|
||||
configureHondaAccordCDDip(this PASS_ENGINE_PARAMETER);
|
||||
configureHondaAccordCDDip(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_HONDA_CBR_600:
|
||||
configureHondaCbr600(this PASS_ENGINE_PARAMETER);
|
||||
configureHondaCbr600(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_HONDA_CBR_600_CUSTOM:
|
||||
configureHondaCbr600custom(this PASS_ENGINE_PARAMETER);
|
||||
configureHondaCbr600custom(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_MITSUBISHI:
|
||||
initializeMitsubishi4g18(this PASS_ENGINE_PARAMETER);
|
||||
initializeMitsubishi4g18(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_DODGE_RAM:
|
||||
initDodgeRam(this PASS_ENGINE_PARAMETER);
|
||||
initDodgeRam(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_JEEP_18_2_2_2:
|
||||
initJeep18_2_2_2(this PASS_ENGINE_PARAMETER);
|
||||
initJeep18_2_2_2(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_SUBARU_7_6:
|
||||
initializeSubaru7_6(this PASS_ENGINE_PARAMETER);
|
||||
initializeSubaru7_6(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_36_2_2_2:
|
||||
initialize36_2_2_2(this PASS_ENGINE_PARAMETER);
|
||||
initialize36_2_2_2(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_2JZ_3_34:
|
||||
initialize2jzGE3_34(this PASS_ENGINE_PARAMETER);
|
||||
initialize2jzGE3_34(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_2JZ_1_12:
|
||||
initialize2jzGE1_12(this PASS_ENGINE_PARAMETER);
|
||||
initialize2jzGE1_12(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_NISSAN_SR20VE:
|
||||
initializeNissanSR20VE_4(this PASS_ENGINE_PARAMETER);
|
||||
initializeNissanSR20VE_4(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_NISSAN_SR20VE_360:
|
||||
initializeNissanSR20VE_4_360(this PASS_ENGINE_PARAMETER);
|
||||
initializeNissanSR20VE_4_360(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_ROVER_K:
|
||||
initializeRoverK(this PASS_ENGINE_PARAMETER);
|
||||
initializeRoverK(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
case TT_GM_LS_24:
|
||||
initGmLS24(this PASS_ENGINE_PARAMETER);
|
||||
initGmLS24(this PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -681,7 +681,7 @@ void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMET
|
|||
* #192 BUG real hardware trigger events could be coming even while we are initializing trigger
|
||||
*/
|
||||
initState.reset();
|
||||
calculateTriggerSynchPoint(&initState PASS_ENGINE_PARAMETER);
|
||||
calculateTriggerSynchPoint(&initState PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
static void onFindIndex(TriggerState *state) {
|
||||
|
@ -698,7 +698,7 @@ static void onFindIndex(TriggerState *state) {
|
|||
* This function finds the index of synchronization event within TriggerShape
|
||||
*/
|
||||
uint32_t findTriggerZeroEventIndex(TriggerState *state, TriggerShape * shape,
|
||||
trigger_config_s const*triggerConfig DECLARE_ENGINE_PARAMETER_S) {
|
||||
trigger_config_s const*triggerConfig DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
efiAssert(getRemainingStack(chThdGetSelfX()) > 128, "findPos", -1);
|
||||
#endif
|
||||
|
@ -715,7 +715,7 @@ uint32_t findTriggerZeroEventIndex(TriggerState *state, TriggerShape * shape,
|
|||
// todo: should this variable be declared 'static' to reduce stack usage?
|
||||
TriggerStimulatorHelper helper;
|
||||
|
||||
uint32_t syncIndex = helper.doFindTrigger(shape, triggerConfig, state PASS_ENGINE_PARAMETER);
|
||||
uint32_t syncIndex = helper.doFindTrigger(shape, triggerConfig, state PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (syncIndex == EFI_ERROR_CODE) {
|
||||
isInitializingTrigger = false;
|
||||
return syncIndex;
|
||||
|
@ -736,7 +736,7 @@ uint32_t findTriggerZeroEventIndex(TriggerState *state, TriggerShape * shape,
|
|||
*/
|
||||
state->cycleCallback = onFindIndex;
|
||||
|
||||
helper.assertSyncPositionAndSetDutyCycle(syncIndex, state, shape, triggerConfig PASS_ENGINE_PARAMETER);
|
||||
helper.assertSyncPositionAndSetDutyCycle(syncIndex, state, shape, triggerConfig PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
isInitializingTrigger = false;
|
||||
return syncIndex % shape->getSize();
|
||||
|
|
|
@ -99,7 +99,7 @@ static LocalVersionHolder emulatorConfigVersion;
|
|||
extern WaveChart waveChart;
|
||||
#endif /* EFI_ENGINE_SNIFFER */
|
||||
|
||||
void setTriggerEmulatorRPM(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setTriggerEmulatorRPM(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
engineConfiguration->bc.triggerSimulatorFrequency = rpm;
|
||||
/**
|
||||
* All we need to do here is to change the periodMs
|
||||
|
@ -125,7 +125,7 @@ static void updateTriggerShapeIfNeeded(PwmConfig *state) {
|
|||
scheduleMsg(logger, "Stimulator: updating trigger shape: %d/%d %d", emulatorConfigVersion.getVersion(),
|
||||
getGlobalConfigurationVersion(), currentTimeMillis());
|
||||
|
||||
applyNonPersistentConfiguration(logger PASS_ENGINE_PARAMETER);
|
||||
applyNonPersistentConfiguration(logger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
TriggerShape *s = &engine->triggerCentral.triggerShape;
|
||||
pin_state_t *pinStates[PWM_PHASE_MAX_WAVE_PER_PWM] = { s->wave.waves[0].pinStates, s->wave.waves[1].pinStates,
|
||||
|
@ -168,7 +168,7 @@ void initTriggerEmulatorLogic(Logging *sharedLogger) {
|
|||
logger = sharedLogger;
|
||||
|
||||
TriggerShape *s = &engine->triggerCentral.triggerShape;
|
||||
setTriggerEmulatorRPM(engineConfiguration->bc.triggerSimulatorFrequency PASS_ENGINE_PARAMETER);
|
||||
setTriggerEmulatorRPM(engineConfiguration->bc.triggerSimulatorFrequency PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
pin_state_t *pinStates[PWM_PHASE_MAX_WAVE_PER_PWM] = { s->wave.waves[0].pinStates, s->wave.waves[1].pinStates,
|
||||
s->wave.waves[2].pinStates };
|
||||
triggerSignal.weComplexInit("position sensor", s->getSize(), s->wave.switchTimes, PWM_PHASE_MAX_WAVE_PER_PWM,
|
||||
|
|
|
@ -29,7 +29,7 @@ extern bool printTriggerDebug;
|
|||
#endif /* ! EFI_UNIT_TEST */
|
||||
|
||||
void TriggerStimulatorHelper::nextStep(TriggerState *state, TriggerShape * shape, int i,
|
||||
trigger_config_s const*triggerConfig DECLARE_ENGINE_PARAMETER_S) {
|
||||
trigger_config_s const*triggerConfig DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
int stateIndex = i % shape->getSize();
|
||||
int prevIndex = (stateIndex + shape->getSize() - 1 ) % shape->getSize();
|
||||
|
||||
|
@ -61,30 +61,30 @@ void TriggerStimulatorHelper::nextStep(TriggerState *state, TriggerShape * shape
|
|||
primaryWheelState = newPrimaryWheelState;
|
||||
trigger_event_e s = primaryWheelState ? SHAFT_PRIMARY_RISING : SHAFT_PRIMARY_FALLING;
|
||||
if (isUsefulSignal(s, engineConfiguration))
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER);
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
if (secondaryWheelState != newSecondaryWheelState) {
|
||||
secondaryWheelState = newSecondaryWheelState;
|
||||
trigger_event_e s = secondaryWheelState ? SHAFT_SECONDARY_RISING : SHAFT_SECONDARY_FALLING;
|
||||
if (isUsefulSignal(s, engineConfiguration))
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER);
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
if (thirdWheelState != new3rdWheelState) {
|
||||
thirdWheelState = new3rdWheelState;
|
||||
trigger_event_e s = thirdWheelState ? SHAFT_3RD_RISING : SHAFT_3RD_FALLING;
|
||||
if (isUsefulSignal(s, engineConfiguration))
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER);
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
|
||||
void TriggerStimulatorHelper::assertSyncPositionAndSetDutyCycle(const uint32_t syncIndex, TriggerState *state, TriggerShape * shape,
|
||||
trigger_config_s const*triggerConfig DECLARE_ENGINE_PARAMETER_S) {
|
||||
trigger_config_s const*triggerConfig DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
int startIndex = syncIndex + 1;
|
||||
|
||||
for (uint32_t i = startIndex; i <= syncIndex + 2 * shape->getSize(); i++) {
|
||||
nextStep(state, shape, i, triggerConfig PASS_ENGINE_PARAMETER);
|
||||
nextStep(state, shape, i, triggerConfig PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
int revolutionCounter = state->getTotalRevolutionCounter();
|
||||
if (revolutionCounter != 3) {
|
||||
|
@ -103,9 +103,9 @@ void TriggerStimulatorHelper::assertSyncPositionAndSetDutyCycle(const uint32_t s
|
|||
* @return trigger synchronization point index, or error code if not found
|
||||
*/
|
||||
uint32_t TriggerStimulatorHelper::doFindTrigger(TriggerShape * shape,
|
||||
trigger_config_s const*triggerConfig, TriggerState *state DECLARE_ENGINE_PARAMETER_S) {
|
||||
trigger_config_s const*triggerConfig, TriggerState *state DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
for (int i = 0; i < 4 * PWM_PHASE_MAX_COUNT; i++) {
|
||||
nextStep(state, shape, i, triggerConfig PASS_ENGINE_PARAMETER);
|
||||
nextStep(state, shape, i, triggerConfig PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
if (state->shaft_is_synchronized)
|
||||
return i;
|
||||
|
|
|
@ -42,13 +42,13 @@ TriggerShape::TriggerShape() :
|
|||
memset(triggerIndexByAngle, 0, sizeof(triggerIndexByAngle));
|
||||
}
|
||||
|
||||
void TriggerShape::calculateTriggerSynchPoint(TriggerState *state DECLARE_ENGINE_PARAMETER_S) {
|
||||
void TriggerShape::calculateTriggerSynchPoint(TriggerState *state DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 256, "calc s");
|
||||
#endif
|
||||
trigger_config_s const*triggerConfig = &engineConfiguration->trigger;
|
||||
|
||||
triggerShapeSynchPointIndex = findTriggerZeroEventIndex(state, this, triggerConfig PASS_ENGINE_PARAMETER);
|
||||
triggerShapeSynchPointIndex = findTriggerZeroEventIndex(state, this, triggerConfig PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
int length = getLength();
|
||||
engine->engineCycleEventCount = length;
|
||||
|
@ -276,9 +276,9 @@ angle_t TriggerShape::getAngle(int index) const {
|
|||
return getCycleDuration() * crankCycle + getSwitchAngle(remainder);
|
||||
}
|
||||
|
||||
void TriggerShape::addEvent2(angle_t angle, trigger_wheel_e const waveIndex, trigger_value_e const stateParam, float filterLeft, float filterRight DECLARE_ENGINE_PARAMETER_S) {
|
||||
void TriggerShape::addEvent2(angle_t angle, trigger_wheel_e const waveIndex, trigger_value_e const stateParam, float filterLeft, float filterRight DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
if (angle > filterLeft && angle < filterRight)
|
||||
addEvent2(angle, waveIndex, stateParam PASS_ENGINE_PARAMETER);
|
||||
addEvent2(angle, waveIndex, stateParam PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
operation_mode_e TriggerShape::getOperationMode() {
|
||||
|
@ -289,7 +289,7 @@ operation_mode_e TriggerShape::getOperationMode() {
|
|||
extern bool printTriggerDebug;
|
||||
#endif
|
||||
|
||||
void TriggerShape::addEvent2(angle_t angle, trigger_wheel_e const waveIndex, trigger_value_e const stateParam DECLARE_ENGINE_PARAMETER_S) {
|
||||
void TriggerShape::addEvent2(angle_t angle, trigger_wheel_e const waveIndex, trigger_value_e const stateParam DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
efiAssertVoid(operationMode != OM_NONE, "operationMode not set");
|
||||
|
||||
efiAssertVoid(waveIndex!= T_SECONDARY || needSecondTriggerInput, "secondary needed or not?");
|
||||
|
@ -394,7 +394,7 @@ void multi_wave_s::checkSwitchTimes(int size) {
|
|||
checkSwitchTimes2(size, switchTimes);
|
||||
}
|
||||
|
||||
void setVwConfiguration(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
void setVwConfiguration(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
efiAssertVoid(s != NULL, "TriggerShape is NULL");
|
||||
operation_mode_e operationMode = FOUR_STROKE_CRANK_SENSOR;
|
||||
|
||||
|
@ -410,23 +410,23 @@ void setVwConfiguration(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
float toothWidth = 0.5;
|
||||
|
||||
addSkippedToothTriggerEvents(T_PRIMARY, s, 60, 2, toothWidth, 0, engineCycle,
|
||||
NO_LEFT_FILTER, 690 PASS_ENGINE_PARAMETER);
|
||||
NO_LEFT_FILTER, 690 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
float angleDown = engineCycle / totalTeethCount * (totalTeethCount - skippedCount - 1 + (1 - toothWidth) );
|
||||
s->addEvent2(0 + angleDown + 12, T_PRIMARY, TV_RISE, NO_LEFT_FILTER, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(0 + engineCycle, T_PRIMARY, TV_FALL, NO_LEFT_FILTER, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(0 + angleDown + 12, T_PRIMARY, TV_RISE, NO_LEFT_FILTER, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(0 + engineCycle, T_PRIMARY, TV_FALL, NO_LEFT_FILTER, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->setTriggerSynchronizationGap2(1.6, 4);
|
||||
}
|
||||
|
||||
void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped,
|
||||
operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S) {
|
||||
operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
||||
|
||||
s->useRiseEdge = true;
|
||||
|
||||
initializeSkippedToothTriggerShapeExt(s, total, skipped,
|
||||
operationMode PASS_ENGINE_PARAMETER);
|
||||
operationMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -44,11 +44,11 @@ static void emulate(void) {
|
|||
for (int i = 400; i <= 1300; i++) {
|
||||
if (i % 50 != 0)
|
||||
continue;
|
||||
setTriggerEmulatorRPM(i PASS_ENGINE_PARAMETER);
|
||||
setTriggerEmulatorRPM(i PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
chThdSleepMilliseconds(PERIOD);
|
||||
}
|
||||
|
||||
setTriggerEmulatorRPM(0 PASS_ENGINE_PARAMETER);
|
||||
setTriggerEmulatorRPM(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
setFullLog(0);
|
||||
setDiag(0);
|
||||
|
@ -103,5 +103,5 @@ void initEngineEmulator(Logging *sharedLogger, Engine *engine) {
|
|||
#endif /* EFI_POTENTIOMETER */
|
||||
|
||||
//initECUstimulator();
|
||||
initTriggerEmulator(sharedLogger PASS_ENGINE_PARAMETER);
|
||||
initTriggerEmulator(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
|
|
@ -98,13 +98,13 @@ typedef unsigned int time_t;
|
|||
extern EnginePins enginePins
|
||||
|
||||
// Use this macro to declare a function which only takes magic references
|
||||
#define DECLARE_ENGINE_PARAMETER_F void
|
||||
#define DECLARE_ENGINE_PARAMETER_SIGNATURE void
|
||||
// Use this version of the macro as the suffix if method has other parameters
|
||||
#define DECLARE_ENGINE_PARAMETER_S
|
||||
#define DECLARE_ENGINE_PARAMETER_SUFFIX
|
||||
// Pass this if only magic reference are needed
|
||||
#define PASS_ENGINE_PARAMETER_F
|
||||
#define PASS_ENGINE_PARAMETER_SIGNATURE
|
||||
// Pass this after some other parameters are passed
|
||||
#define PASS_ENGINE_PARAMETER
|
||||
#define PASS_ENGINE_PARAMETER_SUFFIX
|
||||
|
||||
/**
|
||||
* this macro allows the compiled to figure out the complete static address, that's a performance
|
||||
|
|
|
@ -351,14 +351,14 @@ void initHardware(Logging *l) {
|
|||
*/
|
||||
if (SHOULD_INGORE_FLASH()) {
|
||||
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
||||
resetConfigurationExt(sharedLogger, engineConfiguration->engineType PASS_ENGINE_PARAMETER);
|
||||
resetConfigurationExt(sharedLogger, engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
writeToFlashNow();
|
||||
} else {
|
||||
readFromFlash();
|
||||
}
|
||||
#else
|
||||
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
||||
resetConfigurationExt(sharedLogger, engineConfiguration->engineType PASS_ENGINE_PARAMETER);
|
||||
resetConfigurationExt(sharedLogger, engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#endif /* EFI_INTERNAL_FLASH */
|
||||
|
||||
#if EFI_HD44780_LCD
|
||||
|
|
|
@ -105,10 +105,10 @@ void applyNewConfiguration(void);
|
|||
extern persistent_config_container_s persistentState; \
|
||||
extern EnginePins enginePins
|
||||
|
||||
#define DECLARE_ENGINE_PARAMETER_F void
|
||||
#define DECLARE_ENGINE_PARAMETER_S
|
||||
#define PASS_ENGINE_PARAMETER_F
|
||||
#define PASS_ENGINE_PARAMETER
|
||||
#define DECLARE_ENGINE_PARAMETER_SIGNATURE void
|
||||
#define DECLARE_ENGINE_PARAMETER_SUFFIX
|
||||
#define PASS_ENGINE_PARAMETER_SIGNATURE
|
||||
#define PASS_ENGINE_PARAMETER_SUFFIX
|
||||
|
||||
#define CONFIG(x) persistentState.persistentConfiguration.engineConfiguration.x
|
||||
#define ENGINE(x) engine->x
|
||||
|
|
|
@ -94,13 +94,13 @@ void rusEfiFunctionalTest(void) {
|
|||
initializeConsole(&sharedLogger);
|
||||
|
||||
initStatusLoop();
|
||||
initDataStructures(PASS_ENGINE_PARAMETER_F);
|
||||
initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
// todo: reduce code duplication with initEngineContoller
|
||||
|
||||
resetConfigurationExt(NULL, DEFAULT_ENGINE_TYPE PASS_ENGINE_PARAMETER);
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_F);
|
||||
resetConfigurationExt(NULL, DEFAULT_ENGINE_TYPE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
initAlgo(&sharedLogger);
|
||||
commonInitEngineController(&sharedLogger);
|
||||
|
@ -113,7 +113,7 @@ void rusEfiFunctionalTest(void) {
|
|||
|
||||
initTriggerCentral(&sharedLogger);
|
||||
|
||||
initTriggerEmulator(&sharedLogger PASS_ENGINE_PARAMETER);
|
||||
initTriggerEmulator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
#if EFI_MAP_AVERAGING || defined(__DOXYGEN__)
|
||||
initMapAveraging(&sharedLogger, engine);
|
||||
|
@ -125,9 +125,9 @@ void rusEfiFunctionalTest(void) {
|
|||
|
||||
runChprintfTest();
|
||||
|
||||
initPeriodicEvents(PASS_ENGINE_PARAMETER_F);
|
||||
initPeriodicEvents(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
setTriggerEmulatorRPM(DEFAULT_SIM_RPM PASS_ENGINE_PARAMETER);
|
||||
setTriggerEmulatorRPM(DEFAULT_SIM_RPM PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engineConfiguration->engineSnifferRpmThreshold = DEFAULT_SNIFFER_THR;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,24 +45,24 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persiste
|
|||
setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 70, 1.01);
|
||||
|
||||
Engine *engine = &this->engine;
|
||||
prepareFuelMap(PASS_ENGINE_PARAMETER_F);
|
||||
prepareFuelMap(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
initAccelEnrichment(NULL PASS_ENGINE_PARAMETER);
|
||||
initAccelEnrichment(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
initSpeedDensity(PASS_ENGINE_PARAMETER_F);
|
||||
initSpeedDensity(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
resetConfigurationExt(NULL, engineType PASS_ENGINE_PARAMETER);
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_F);
|
||||
resetConfigurationExt(NULL, engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
engine->engineConfiguration->mafAdcChannel = (adc_channel_e)TEST_MAF_CHANNEL;
|
||||
|
||||
initThermistors(NULL PASS_ENGINE_PARAMETER);
|
||||
initThermistors(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// this is needed to have valid CLT and IAT.
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_F);
|
||||
prepareTimingMap(PASS_ENGINE_PARAMETER_F);
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
prepareTimingMap(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
|
||||
engine->triggerCentral.triggerShape.initializeTriggerShape(NULL PASS_ENGINE_PARAMETER);
|
||||
engine->triggerCentral.triggerShape.initializeTriggerShape(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engine->triggerCentral.addEventListener(rpmShaftPositionCallback, "rpm reporter", engine);
|
||||
engine->triggerCentral.addEventListener(mainTriggerCallback, "main loop", engine);
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ void EngineTestHelper::applyTriggerShape() {
|
|||
persistent_config_s *config = engine->config;
|
||||
board_configuration_s *boardConfiguration = &engineConfiguration->bc;
|
||||
|
||||
engine->triggerCentral.triggerShape.initializeTriggerShape(NULL PASS_ENGINE_PARAMETER);
|
||||
engine->triggerCentral.triggerShape.initializeTriggerShape(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
|
|
@ -44,10 +44,10 @@ class Engine;
|
|||
/**
|
||||
* @see firmware/global.h for explanation
|
||||
*/
|
||||
#define DECLARE_ENGINE_PARAMETER_F Engine *engine, engine_configuration_s *engineConfiguration, persistent_config_s *config, board_configuration_s *boardConfiguration
|
||||
#define DECLARE_ENGINE_PARAMETER_S , Engine *engine, engine_configuration_s *engineConfiguration, persistent_config_s *config, board_configuration_s *boardConfiguration
|
||||
#define PASS_ENGINE_PARAMETER_F engine, engineConfiguration, config, boardConfiguration
|
||||
#define PASS_ENGINE_PARAMETER , engine, engineConfiguration, config, boardConfiguration
|
||||
#define DECLARE_ENGINE_PARAMETER_SIGNATURE Engine *engine, engine_configuration_s *engineConfiguration, persistent_config_s *config, board_configuration_s *boardConfiguration
|
||||
#define DECLARE_ENGINE_PARAMETER_SUFFIX , Engine *engine, engine_configuration_s *engineConfiguration, persistent_config_s *config, board_configuration_s *boardConfiguration
|
||||
#define PASS_ENGINE_PARAMETER_SIGNATURE engine, engineConfiguration, config, boardConfiguration
|
||||
#define PASS_ENGINE_PARAMETER_SUFFIX , engine, engineConfiguration, config, boardConfiguration
|
||||
|
||||
#define EXPAND_Engine engine_configuration_s *engineConfiguration = engine->engineConfiguration; \
|
||||
persistent_config_s *config = engine->config; \
|
||||
|
|
|
@ -18,24 +18,24 @@ void testAccelEnrichment(void) {
|
|||
EngineTestHelper eth(FORD_ASPIRE_1996);
|
||||
EXPAND_EngineTestHelper;
|
||||
|
||||
engine->rpmCalculator.setRpmValue(600 PASS_ENGINE_PARAMETER);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->rpmCalculator.setRpmValue(600 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engine->tpsAccelEnrichment.setLength(4);
|
||||
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER);
|
||||
assertEqualsM("maxDelta", 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_F));
|
||||
engine->tpsAccelEnrichment.onNewValue(10 PASS_ENGINE_PARAMETER);
|
||||
assertEqualsM("maxDelta#1", 40, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_F));
|
||||
engine->tpsAccelEnrichment.onNewValue(30 PASS_ENGINE_PARAMETER);
|
||||
assertEqualsM("maxDelta#2", 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_F));
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("maxDelta", 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
engine->tpsAccelEnrichment.onNewValue(10 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("maxDelta#1", 40, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
engine->tpsAccelEnrichment.onNewValue(30 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("maxDelta#2", 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER);
|
||||
assertEqualsM("maxDelta#3", 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_F));
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER);
|
||||
assertEqualsM("maxDelta#4", 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_F));
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER);
|
||||
assertEqualsM("maxDelta#5", 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_F));
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER);
|
||||
assertEqualsM("maxDelta", 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_F));
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("maxDelta#3", 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("maxDelta#4", 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("maxDelta#5", 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("maxDelta", 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ void testIgnitionPlanning(void) {
|
|||
EngineTestHelper eth(FORD_ESCORT_GT);
|
||||
EXPAND_EngineTestHelper;
|
||||
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("testIgnitionPlanning_AFR", 13.5, eth.engine.engineState.targetAFR);
|
||||
|
||||
assertEquals(IM_BATCH, engineConfiguration->injectionMode);
|
||||
|
@ -38,14 +38,14 @@ void testEngineMath(void) {
|
|||
assertEqualsM("6000 RPM", 5, getOneDegreeTimeMs(6000) * 180);
|
||||
|
||||
|
||||
assertEquals(312.5, getTCharge(1000, 0, 300, 350 PASS_ENGINE_PARAMETER));
|
||||
assertEquals(313.5833, getTCharge(1000, 50, 300, 350 PASS_ENGINE_PARAMETER));
|
||||
assertEquals(314.6667, getTCharge(1000, 100, 300, 350 PASS_ENGINE_PARAMETER));
|
||||
assertEquals(312.5, getTCharge(1000, 0, 300, 350 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEquals(313.5833, getTCharge(1000, 50, 300, 350 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEquals(314.6667, getTCharge(1000, 100, 300, 350 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
|
||||
assertEquals(312.5, getTCharge(4000, 0, 300, 350 PASS_ENGINE_PARAMETER));
|
||||
assertEquals(320.0833, getTCharge(4000, 50, 300, 350 PASS_ENGINE_PARAMETER));
|
||||
assertEquals(327.6667, getTCharge(4000, 100, 300, 350 PASS_ENGINE_PARAMETER));
|
||||
assertEquals(312.5, getTCharge(4000, 0, 300, 350 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEquals(320.0833, getTCharge(4000, 50, 300, 350 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEquals(327.6667, getTCharge(4000, 100, 300, 350 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
}
|
||||
|
||||
void testIgnitionMapGenerator(void) {
|
||||
|
|
|
@ -29,7 +29,7 @@ void testMafFuelMath(void) {
|
|||
|
||||
setAfrMap(config->afrTable, 13);
|
||||
|
||||
float fuelMs = getRealMafFuel(300, 6000 PASS_ENGINE_PARAMETER);
|
||||
float fuelMs = getRealMafFuel(300, 6000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("fuelMs", 26.7099, fuelMs);
|
||||
}
|
||||
|
||||
|
@ -58,20 +58,20 @@ void testFuelMap(void) {
|
|||
|
||||
printf("*** getInjectorLag\r\n");
|
||||
// engine->engineState.vb
|
||||
assertEqualsM("lag", 1.04, getInjectorLag(12 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("lag", 1.04, getInjectorLag(12 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
for (int i = 0; i < VBAT_INJECTOR_CURVE_SIZE; i++) {
|
||||
eth.engine.engineConfiguration->injector.battLagCorrBins[i] = i;
|
||||
eth.engine.engineConfiguration->injector.battLagCorr[i] = 0.5 + 2 * i;
|
||||
}
|
||||
|
||||
eth.engine.updateSlowSensors(PASS_ENGINE_PARAMETER_F);
|
||||
eth.engine.updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// because all the correction tables are zero
|
||||
printf("*************************************************** getRunningFuel 1\r\n");
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
float baseFuel = getBaseTableFuel(5, getEngineLoadT(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("base fuel", 5.05, getRunningFuel(baseFuel PASS_ENGINE_PARAMETER));
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
float baseFuel = getBaseTableFuel(5, getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
assertEqualsM("base fuel", 5.05, getRunningFuel(baseFuel PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
printf("*************************************************** setting IAT table\r\n");
|
||||
for (int i = 0; i < IAT_CURVE_SIZE; i++) {
|
||||
|
@ -86,24 +86,24 @@ void testFuelMap(void) {
|
|||
eth.engine.config->cltFuelCorr[i] = 100;
|
||||
}
|
||||
|
||||
setInjectorLag(0 PASS_ENGINE_PARAMETER);
|
||||
setInjectorLag(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
assertEquals(NAN, getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F));
|
||||
float iatCorrection = getIatFuelCorrection(-KELV PASS_ENGINE_PARAMETER);
|
||||
assertEquals(NAN, getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
float iatCorrection = getIatFuelCorrection(-KELV PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("IAT", 2, iatCorrection);
|
||||
engine->sensors.clt = getCoolantTemperature(PASS_ENGINE_PARAMETER_F);
|
||||
float cltCorrection = getCltFuelCorrection(PASS_ENGINE_PARAMETER_F);
|
||||
engine->sensors.clt = getCoolantTemperature(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
float cltCorrection = getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("CLT", 1, cltCorrection);
|
||||
float injectorLag = getInjectorLag(getVBatt(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER);
|
||||
float injectorLag = getInjectorLag(getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("injectorLag", 0, injectorLag);
|
||||
|
||||
testMafValue = 5;
|
||||
|
||||
// 1005 * 2 for IAT correction
|
||||
printf("*************************************************** getRunningFuel 2\r\n");
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
baseFuel = getBaseTableFuel(5, getEngineLoadT(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("v1", 30150, getRunningFuel(baseFuel PASS_ENGINE_PARAMETER));
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
baseFuel = getBaseTableFuel(5, getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
assertEqualsM("v1", 30150, getRunningFuel(baseFuel PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
testMafValue = 0;
|
||||
|
||||
|
@ -111,28 +111,28 @@ void testFuelMap(void) {
|
|||
|
||||
printf("*************************************************** getStartingFuel\r\n");
|
||||
// NAN in case we have issues with the CLT sensor
|
||||
assertEqualsM("getStartingFuel nan", 4, getCrankingFuel3(NAN, 0 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("getStartingFuel#1", 17.8, getCrankingFuel3(0, 4 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("getStartingFuel#2", 8.4480, getCrankingFuel3(8, 15 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("getStartingFuel#3", 6.48, getCrankingFuel3(70, 0 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("getStartingFuel#4", 2.6069, getCrankingFuel3(70, 50 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("getStartingFuel nan", 4, getCrankingFuel3(NAN, 0 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEqualsM("getStartingFuel#1", 17.8, getCrankingFuel3(0, 4 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEqualsM("getStartingFuel#2", 8.4480, getCrankingFuel3(8, 15 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEqualsM("getStartingFuel#3", 6.48, getCrankingFuel3(70, 0 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEqualsM("getStartingFuel#4", 2.6069, getCrankingFuel3(70, 50 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
}
|
||||
|
||||
|
||||
static void confgiureFordAspireTriggerShape(TriggerShape * s DECLARE_ENGINE_PARAMETER_S) {
|
||||
static void confgiureFordAspireTriggerShape(TriggerShape * s DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
s->addEvent2(53.747, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(121.90, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(232.76, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(300.54, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(53.747, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(121.90, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(232.76, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(300.54, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(360, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
s->addEvent2(409.8412, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(478.6505, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(588.045, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(657.03, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(409.8412, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(478.6505, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(588.045, T_SECONDARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(657.03, T_SECONDARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
s->addEvent2(720, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
assertEquals(53.747 / 720, s->wave.getSwitchTime(0));
|
||||
assertEqualsM("@0", 1, s->wave.getChannelState(1, 0));
|
||||
|
@ -170,7 +170,7 @@ void testAngleResolver(void) {
|
|||
engineConfiguration->globalTriggerAngleOffset = 175;
|
||||
|
||||
TriggerShape * ts = &engine->triggerCentral.triggerShape;
|
||||
ts->initializeTriggerShape(NULL PASS_ENGINE_PARAMETER);
|
||||
ts->initializeTriggerShape(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
assertEqualsM("index 2", 52.76, ts->eventAngles[3]); // this angle is relation to synch point
|
||||
assertEqualsM("time 2", 0.3233, ts->wave.getSwitchTime(2));
|
||||
|
@ -184,37 +184,37 @@ void testAngleResolver(void) {
|
|||
event_trigger_position_s injectionStart;
|
||||
|
||||
printf("*************************************************** testAngleResolver 0\r\n");
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, -122 PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, -122 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEqualsM("eventIndex@0", 2, injectionStart.eventIndex);
|
||||
assertEquals(0.24, injectionStart.angleOffset);
|
||||
|
||||
printf("*************************************************** testAngleResolver 0.1\r\n");
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, -80 PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, -80 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEqualsM("eventIndex@0", 2, injectionStart.eventIndex);
|
||||
assertEquals(42.24, injectionStart.angleOffset);
|
||||
|
||||
printf("*************************************************** testAngleResolver 0.2\r\n");
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, -54 PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, -54 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEqualsM("eventIndex@0", 2, injectionStart.eventIndex);
|
||||
assertEquals(68.2400, injectionStart.angleOffset);
|
||||
|
||||
printf("*************************************************** testAngleResolver 0.3\r\n");
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, -53 PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, -53 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEquals(2, injectionStart.eventIndex);
|
||||
assertEquals(69.24, injectionStart.angleOffset);
|
||||
|
||||
printf("*************************************************** testAngleResolver 1\r\n");
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, 0 PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, 0 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEquals(2, injectionStart.eventIndex);
|
||||
assertEquals(122.24, injectionStart.angleOffset);
|
||||
|
||||
printf("*************************************************** testAngleResolver 2\r\n");
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, 56 PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&injectionStart, 56 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEquals(2, injectionStart.eventIndex);
|
||||
assertEquals(178.24, injectionStart.angleOffset);
|
||||
|
||||
TriggerShape t;
|
||||
confgiureFordAspireTriggerShape(&t PASS_ENGINE_PARAMETER);
|
||||
confgiureFordAspireTriggerShape(&t PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
void testPinHelper(void) {
|
||||
|
|
|
@ -20,12 +20,12 @@ static void testMapDecoding(void) {
|
|||
air_pressure_sensor_config_s s;
|
||||
s.type = MT_DENSO183;
|
||||
|
||||
assertEqualsM("denso 0 volts", -6.64, decodePressure(0, &s PASS_ENGINE_PARAMETER));
|
||||
assertEquals(31.244, decodePressure(1, &s PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("denso 0 volts", -6.64, decodePressure(0, &s PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEquals(31.244, decodePressure(1, &s PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
s.type = MT_MPX4250;
|
||||
assertEqualsM("MPX_4250 0 volts", 8, decodePressure(0, &s PASS_ENGINE_PARAMETER));
|
||||
assertEquals(58.4, decodePressure(1, &s PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("MPX_4250 0 volts", 8, decodePressure(0, &s PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEquals(58.4, decodePressure(1, &s PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
}
|
||||
|
||||
void testTps(void) {
|
||||
|
@ -37,12 +37,12 @@ void testTps(void) {
|
|||
engineConfiguration->tpsMax = 193;
|
||||
engineConfiguration->tpsMin = 43;
|
||||
|
||||
assertEquals(49.3333, getTpsValue(4 * 117 PASS_ENGINE_PARAMETER));
|
||||
assertEquals(49.3333, getTpsValue(4 * 117 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
|
||||
engineConfiguration->tpsMax = 43;
|
||||
engineConfiguration->tpsMin = 193;
|
||||
assertEqualsM("test#2", 50.6667, getTpsValue(4 * 117 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("test#2", 50.6667, getTpsValue(4 * 117 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
}
|
||||
|
||||
void testTpsRateOfChange(void) {
|
||||
|
|
|
@ -51,10 +51,10 @@ static int getTriggerZeroEventIndex(engine_type_e engineType) {
|
|||
EngineTestHelper eth(engineType);
|
||||
EXPAND_EngineTestHelper;
|
||||
|
||||
initDataStructures(PASS_ENGINE_PARAMETER_F);
|
||||
initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
TriggerShape * shape = ð.engine.triggerCentral.triggerShape;
|
||||
return findTriggerZeroEventIndex(ð.engine.triggerCentral.triggerState, shape, &engineConfiguration->trigger PASS_ENGINE_PARAMETER);
|
||||
return findTriggerZeroEventIndex(ð.engine.triggerCentral.triggerState, shape, &engineConfiguration->trigger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
static void testDodgeNeonDecoder(void) {
|
||||
|
@ -128,25 +128,25 @@ void test1995FordInline6TriggerDecoder(void) {
|
|||
assertEqualsM("triggerShapeSynchPointIndex", 0, shape->getTriggerShapeSynchPointIndex());
|
||||
|
||||
// this is needed to have valid CLT and IAT. todo: extract method
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_F);
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
event_trigger_position_s position;
|
||||
assertEqualsM("globalTriggerAngleOffset", 0, engineConfiguration->globalTriggerAngleOffset);
|
||||
TRIGGER_SHAPE(findTriggerPosition(&position, 0 PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&position, 0 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertTriggerPosition(&position, 0, 0);
|
||||
|
||||
TRIGGER_SHAPE(findTriggerPosition(&position, 200 PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&position, 200 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertTriggerPosition(&position, 3, 20);
|
||||
|
||||
TRIGGER_SHAPE(findTriggerPosition(&position, 360 PASS_ENGINE_PARAMETER));
|
||||
TRIGGER_SHAPE(findTriggerPosition(&position, 360 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertTriggerPosition(&position, 6, 0);
|
||||
|
||||
eth.applyTriggerShape();
|
||||
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
eth.fireTriggerEvents(48);
|
||||
assertEquals(2000, eth.engine.rpmCalculator.rpmValue);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
eth.fireTriggerEvents(48);
|
||||
|
||||
IgnitionEventList *ecl = ð.engine.ignitionEvents;
|
||||
|
@ -161,31 +161,31 @@ void test1995FordInline6TriggerDecoder(void) {
|
|||
|
||||
assertFalseM("shaft_is_synchronized", state.shaft_is_synchronized);
|
||||
int r = 10;
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r PASS_ENGINE_PARAMETER);
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertFalseM("shaft_is_synchronized", state.shaft_is_synchronized); // still no synchronization
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_RISING, ++r PASS_ENGINE_PARAMETER);
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_RISING, ++r PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertTrue(state.shaft_is_synchronized); // first signal rise synchronize
|
||||
assertEquals(0, state.getCurrentIndex());
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER);
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEquals(1, state.getCurrentIndex());
|
||||
|
||||
for (int i = 2; i < 10;) {
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER);
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("even", i++, state.getCurrentIndex());
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER);
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("odd", i++, state.getCurrentIndex());
|
||||
}
|
||||
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER);
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEquals(10, state.getCurrentIndex());
|
||||
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER);
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEquals(11, state.getCurrentIndex());
|
||||
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER);
|
||||
state.decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEquals(0, state.getCurrentIndex()); // new revolution
|
||||
|
||||
assertEqualsM("running dwell", 0.5, getSparkDwell(2000 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("running dwell", 0.5, getSparkDwell(2000 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
}
|
||||
|
||||
void testFordAspire(void) {
|
||||
|
@ -204,10 +204,10 @@ void testFordAspire(void) {
|
|||
engineConfiguration->crankingChargeAngle = 65;
|
||||
engineConfiguration->crankingTimingAngle = 31;
|
||||
|
||||
assertEqualsM("cranking dwell", 54.166670, getSparkDwell(200 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("running dwell", 4, getSparkDwell(2000 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("cranking dwell", 54.166670, getSparkDwell(200 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
assertEqualsM("running dwell", 4, getSparkDwell(2000 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
assertEqualsM("higher rpm dwell", 3.25, getSparkDwell(6000 PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("higher rpm dwell", 3.25, getSparkDwell(6000 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
}
|
||||
|
||||
void testTriggerDecoder2(const char *msg, engine_type_e type, int synchPointIndex, float channel1duty, float channel2duty) {
|
||||
|
@ -216,7 +216,7 @@ void testTriggerDecoder2(const char *msg, engine_type_e type, int synchPointInde
|
|||
EngineTestHelper eth(type);
|
||||
EXPAND_EngineTestHelper;
|
||||
|
||||
initSpeedDensity(PASS_ENGINE_PARAMETER_F);
|
||||
initSpeedDensity(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
TriggerShape *t = ð.engine.triggerCentral.triggerShape;
|
||||
|
||||
|
@ -252,31 +252,31 @@ void testStartupFuelPumping(void) {
|
|||
engine->engineConfiguration->tpsMax = 10;
|
||||
|
||||
mockTps = TPS_TS_CONVERSION * 6;
|
||||
sf.update(PASS_ENGINE_PARAMETER_F);
|
||||
sf.update(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("pc#1", 1, sf.pumpsCounter);
|
||||
|
||||
mockTps = TPS_TS_CONVERSION * 3;
|
||||
sf.update(PASS_ENGINE_PARAMETER_F);
|
||||
sf.update(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("pumpsCounter#2", 1, sf.pumpsCounter);
|
||||
|
||||
sf.update(PASS_ENGINE_PARAMETER_F);
|
||||
sf.update(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("pc#3", 1, sf.pumpsCounter);
|
||||
|
||||
engine->rpmCalculator.mockRpm = 10;
|
||||
sf.update(PASS_ENGINE_PARAMETER_F);
|
||||
sf.update(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("pc#4", 0, sf.pumpsCounter);
|
||||
|
||||
mockTps = TPS_TS_CONVERSION * 7;
|
||||
engine->rpmCalculator.mockRpm = 0;
|
||||
sf.update(PASS_ENGINE_PARAMETER_F);
|
||||
sf.update(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("pc#5", 1, sf.pumpsCounter);
|
||||
|
||||
mockTps = TPS_TS_CONVERSION * 3;
|
||||
sf.update(PASS_ENGINE_PARAMETER_F);
|
||||
sf.update(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("pc#6", 1, sf.pumpsCounter);
|
||||
|
||||
mockTps = TPS_TS_CONVERSION * 7;
|
||||
sf.update(PASS_ENGINE_PARAMETER_F);
|
||||
sf.update(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("pc#7", 2, sf.pumpsCounter);
|
||||
}
|
||||
|
||||
|
@ -314,18 +314,18 @@ void testRpmCalculator(void) {
|
|||
engineConfiguration->globalFuelCorrection = 3;
|
||||
eth.applyTriggerShape();
|
||||
|
||||
setInjectorLag(0 PASS_ENGINE_PARAMETER);
|
||||
setInjectorLag(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_F);
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
timeNow = 0;
|
||||
assertEquals(0, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEquals(0, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
assertEquals(4, TRIGGER_SHAPE(triggerIndexByAngle[240]));
|
||||
assertEquals(4, TRIGGER_SHAPE(triggerIndexByAngle[241]));
|
||||
|
||||
eth.fireTriggerEvents(48);
|
||||
|
||||
assertEqualsM("RPM", 1500, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("RPM", 1500, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
assertEqualsM("index #1", 15, eth.engine.triggerCentral.triggerState.getCurrentIndex());
|
||||
|
||||
|
||||
|
@ -343,15 +343,15 @@ void testRpmCalculator(void) {
|
|||
assertEqualsM("st value", 485000, st);
|
||||
|
||||
// todo: why is this required here? we already have one 'prepareOutputSignals' in constructor, what's wrong with it?
|
||||
prepareOutputSignals(PASS_ENGINE_PARAMETER_F);
|
||||
prepareOutputSignals(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
assertEqualsM("fuel #1", 4.5450, eth.engine.fuelMs);
|
||||
InjectionEvent *ie0 = ð.engine.injectionEvents.elements[0];
|
||||
assertEqualsM("injection angle", 31.365, ie0->injectionStart.angleOffset);
|
||||
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEquals(1500, eth.engine.rpmCalculator.rpmValue);
|
||||
|
||||
assertEqualsM("dwell", 4.5, eth.engine.engineState.dwellAngle);
|
||||
|
@ -380,11 +380,11 @@ void testRpmCalculator(void) {
|
|||
schedulingQueue.clear();
|
||||
|
||||
timeNow += 5000;
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
timeNow += 5000; // 5ms
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
timeNow += 5000;
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("index #3", 3, eth.engine.triggerCentral.triggerState.getCurrentIndex());
|
||||
assertEqualsM("queue size 3", 4, schedulingQueue.size());
|
||||
assertEqualsM("ev 3", st + 13333 - 1515, schedulingQueue.getForUnitText(0)->momentX);
|
||||
|
@ -396,15 +396,15 @@ void testRpmCalculator(void) {
|
|||
assertEquals(5, TRIGGER_SHAPE(triggerIndexByAngle[241]));
|
||||
|
||||
timeNow += 5000;
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("queue size 4.1", 0, schedulingQueue.size());
|
||||
|
||||
timeNow += 5000; // 5ms
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("queue size 4.2", 4, schedulingQueue.size());
|
||||
|
||||
timeNow += 5000; // 5ms
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("queue size 4.3", 4, schedulingQueue.size());
|
||||
|
||||
assertEqualsM("dwell", 4.5, eth.engine.engineState.dwellAngle);
|
||||
|
@ -419,25 +419,25 @@ void testRpmCalculator(void) {
|
|||
schedulingQueue.clear();
|
||||
|
||||
timeNow += 5000;
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("queue size 5", 2, schedulingQueue.size());
|
||||
// todo: assert queue elements
|
||||
schedulingQueue.clear();
|
||||
|
||||
timeNow += 5000; // 5ms
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("queue size 6", 2, schedulingQueue.size());
|
||||
assertEqualsM("6/0", st + 40944, schedulingQueue.getForUnitText(0)->momentX);
|
||||
assertEqualsM("6/1", st + 41444, schedulingQueue.getForUnitText(1)->momentX);
|
||||
schedulingQueue.clear();
|
||||
|
||||
timeNow += 5000;
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("queue size 7", 0, schedulingQueue.size());
|
||||
schedulingQueue.clear();
|
||||
|
||||
timeNow += 5000; // 5ms
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("queue size 8", 4, schedulingQueue.size());
|
||||
// todo: assert queue elements completely
|
||||
assertEqualsM("8/0", st + 53333 - 1515, schedulingQueue.getForUnitText(0)->momentX);
|
||||
|
@ -446,12 +446,12 @@ void testRpmCalculator(void) {
|
|||
schedulingQueue.clear();
|
||||
|
||||
timeNow += 5000;
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("queue size 9", 0, schedulingQueue.size());
|
||||
schedulingQueue.clear();
|
||||
|
||||
timeNow += 5000; // 5ms
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER);
|
||||
eth.engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_RISING PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("queue size 10", 0, schedulingQueue.size());
|
||||
schedulingQueue.clear();
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ void testTriggerDecoder(void) {
|
|||
engine_configuration_s *engineConfiguration = &c.engineConfiguration;
|
||||
board_configuration_s *boardConfiguration = &c.engineConfiguration.bc;
|
||||
|
||||
initializeSkippedToothTriggerShapeExt(s, 2, 0, FOUR_STROKE_CAM_SENSOR PASS_ENGINE_PARAMETER);
|
||||
initializeSkippedToothTriggerShapeExt(s, 2, 0, FOUR_STROKE_CAM_SENSOR PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertEqualsM("shape size", s->getSize(), 4);
|
||||
assertEquals(s->wave.switchTimes[0], 0.25);
|
||||
assertEquals(s->wave.switchTimes[1], 0.5);
|
||||
|
@ -523,7 +523,7 @@ void testTriggerDecoder(void) {
|
|||
EngineTestHelper eth(MITSU_4G93);
|
||||
EXPAND_EngineTestHelper;
|
||||
|
||||
initSpeedDensity(PASS_ENGINE_PARAMETER_F);
|
||||
initSpeedDensity(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// TriggerShape *t = ð.engine.triggerShape;
|
||||
// assertEquals(1, t->eventAngles[1]);
|
||||
|
@ -547,7 +547,7 @@ void testTriggerDecoder(void) {
|
|||
|
||||
eth.persistentConfig.engineConfiguration.useOnlyRisingEdgeForTrigger = false;
|
||||
eth.persistentConfig.engineConfiguration.bc.sensorChartMode = SC_DETAILED_RPM;
|
||||
applyNonPersistentConfiguration(NULL PASS_ENGINE_PARAMETER);
|
||||
applyNonPersistentConfiguration(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// assertEqualsM2("rpm#1", 16666.9746, eth.engine.triggerCentral.triggerState.instantRpmValue[0], 0.5);
|
||||
// assertEqualsM2("rpm#2", 16666.3750, eth.engine.triggerCentral.triggerState.instantRpmValue[1], 0.5);
|
||||
|
@ -570,8 +570,8 @@ void testTriggerDecoder(void) {
|
|||
printf("!!!!!!!!!!!!!!!!!! Now trying with only rising edges !!!!!!!!!!!!!!!!!\r\n");
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
applyNonPersistentConfiguration(NULL PASS_ENGINE_PARAMETER);
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_F);
|
||||
applyNonPersistentConfiguration(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
printTriggerDebug = false;
|
||||
}
|
||||
|
@ -631,12 +631,12 @@ static void setTestBug299small(EngineTestHelper *eth) {
|
|||
setArrayValues(config->cltFuelCorrBins, CLT_CURVE_SIZE, 1);
|
||||
setArrayValues(engineConfiguration->injector.battLagCorr, VBAT_INJECTOR_CURVE_SIZE, 0);
|
||||
// this is needed to update injectorLag
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_F);
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
assertEqualsM("CLT", 70, engine->sensors.clt);
|
||||
|
||||
engineConfiguration->trigger.type = TT_ONE;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
eth->applyTriggerShape();
|
||||
|
||||
|
@ -648,12 +648,12 @@ static void setTestBug299(EngineTestHelper *eth) {
|
|||
EXPAND_Engine
|
||||
|
||||
|
||||
assertEqualsM("RPM=0", 0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("RPM=0", 0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
eth->fireTriggerEvents2(1, MS2US(20));
|
||||
// still no RPM since need to cycles measure cycle duration
|
||||
assertEqualsM("RPM#1", 0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("RPM#1", 0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
eth->fireTriggerEvents2(1, MS2US(20));
|
||||
assertEqualsM("RPM#2", 3000, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("RPM#2", 3000, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
schedulingQueue.executeAll(99999999); // this is needed to clear 'isScheduled' flag
|
||||
engine->iHead = NULL; // let's drop whatever was scheduled just to start from a clean state
|
||||
|
@ -744,20 +744,20 @@ static void setTestBug299(EngineTestHelper *eth) {
|
|||
|
||||
|
||||
testMafValue = 0;
|
||||
assertEqualsM("maf", 0, getMaf(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("maf", 0, getMaf(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
assertEqualsM("iatC", 1, engine->engineState.iatFuelCorrection);
|
||||
assertEqualsM("cltC", 1, engine->engineState.cltFuelCorrection);
|
||||
assertEqualsM("lag", 0, engine->engineState.injectorLag);
|
||||
|
||||
assertEqualsM("RPM", 3000, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("RPM", 3000, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
assertEqualsM("fuel#1", 1.5, engine->fuelMs);
|
||||
|
||||
assertEqualsM("duty for maf=0", 7.5, getInjectorDutyCycle(engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("duty for maf=0", 7.5, getInjectorDutyCycle(engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
testMafValue = 3;
|
||||
assertEqualsM("maf", 3, getMaf(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("maf", 3, getMaf(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
}
|
||||
|
||||
static void assertInjectors(const char *msg, int value0, int value1) {
|
||||
|
@ -782,9 +782,9 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 25);
|
||||
setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 25);
|
||||
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("fuel#2", 12.5, engine->fuelMs);
|
||||
assertEqualsM("duty for maf=3", 62.5, getInjectorDutyCycle(eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("duty for maf=3", 62.5, getInjectorDutyCycle(eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
assertEqualsM("qs#1", 4, schedulingQueue.size());
|
||||
timeNow += MS2US(20);
|
||||
|
@ -843,7 +843,7 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
/**
|
||||
* one more revolution
|
||||
*/
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
t = &ENGINE(injectionEvents);
|
||||
|
@ -919,7 +919,7 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
|
||||
eth.firePrimaryTriggerRise();
|
||||
assertEqualsM("Queue.size#03", 5, schedulingQueue.size());
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertInjectorUpEvent("07@0", 0, MS2US(7.5), 1);
|
||||
assertInjectorDownEvent("07@1", 1, MS2US(10), 0);
|
||||
assertInjectorUpEvent("07@2", 2, MS2US(17.5), 0);
|
||||
|
@ -943,15 +943,15 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
|
||||
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 35);
|
||||
setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 35);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("fuel#3", 17.5, engine->fuelMs);
|
||||
// duty cycle above 75% is a special use-case because 'special' fuel event overlappes the next normal event in batch mode
|
||||
assertEqualsM("duty for maf=3", 87.5, getInjectorDutyCycle(eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("duty for maf=3", 87.5, getInjectorDutyCycle(eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
|
||||
assertInjectionEvent("#03", &t->elements[0], 0, 0, 315, false);
|
||||
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
assertEqualsM("inj#0", 1, enginePins.injectors[0].currentLogicValue);
|
||||
|
@ -967,7 +967,7 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
|
||||
|
||||
schedulingQueue.executeAll(timeNow);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
timeNow += MS2US(20);
|
||||
eth.firePrimaryTriggerRise();
|
||||
|
@ -982,7 +982,7 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
schedulingQueue.executeAll(timeNow);
|
||||
eth.firePrimaryTriggerRise();
|
||||
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
t = &ENGINE(injectionEvents);
|
||||
|
||||
|
@ -1023,9 +1023,9 @@ void testFuelSchedulerBug299smallAndLarge(void) {
|
|||
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 35);
|
||||
setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 35);
|
||||
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("Lfuel#2", 17.5, engine->fuelMs);
|
||||
assertEqualsM("Lduty for maf=3", 87.5, getInjectorDutyCycle(eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("Lduty for maf=3", 87.5, getInjectorDutyCycle(eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
|
||||
assertEqualsM("Lqs#1", 4, schedulingQueue.size());
|
||||
|
@ -1087,9 +1087,9 @@ void testFuelSchedulerBug299smallAndLarge(void) {
|
|||
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 4);
|
||||
setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 4);
|
||||
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
assertEqualsM("Lfuel#4", 2, engine->fuelMs);
|
||||
assertEqualsM("Lduty for maf=3", 10, getInjectorDutyCycle(eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER));
|
||||
assertEqualsM("Lduty for maf=3", 10, getInjectorDutyCycle(eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
|
||||
eth.firePrimaryTriggerRise();
|
||||
|
@ -1130,22 +1130,22 @@ void testSparkReverseOrderBug319(void) {
|
|||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||
|
||||
setConstantDwell(45 PASS_ENGINE_PARAMETER);
|
||||
setConstantDwell(45 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// this is needed to update injectorLag
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_F);
|
||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
assertEqualsM("CLT", 70, engine->sensors.clt);
|
||||
|
||||
engineConfiguration->trigger.type = TT_ONE;
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_F);
|
||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
eth.applyTriggerShape();
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
timeNow = 0;
|
||||
setWholeTimingTable(0 PASS_ENGINE_PARAMETER);
|
||||
setWholeTimingTable(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
timeNow += MS2US(20);
|
||||
eth.firePrimaryTriggerRise();
|
||||
|
@ -1161,7 +1161,7 @@ void testSparkReverseOrderBug319(void) {
|
|||
timeNow += MS2US(20);
|
||||
eth.firePrimaryTriggerFall();
|
||||
|
||||
assertEqualsM("RPM", 3000, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("RPM", 3000, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
|
||||
assertEqualsM("queue size", 7, schedulingQueue.size());
|
||||
|
@ -1191,7 +1191,7 @@ void testSparkReverseOrderBug319(void) {
|
|||
eth.firePrimaryTriggerRise();
|
||||
schedulingQueue.executeAll(timeNow);
|
||||
|
||||
assertEqualsM("RPM#2", 545, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("RPM#2", 545, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
assertEqualsM("out-of-order #3", 0, enginePins.coils[3].outOfOrder);
|
||||
|
||||
|
@ -1206,7 +1206,7 @@ void testSparkReverseOrderBug319(void) {
|
|||
eth.firePrimaryTriggerRise();
|
||||
schedulingQueue.executeAll(timeNow);
|
||||
|
||||
assertEqualsM("RPM#3", 3000, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("RPM#3", 3000, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
assertEqualsM("out-of-order #5 on c4", 1, enginePins.coils[3].outOfOrder);
|
||||
|
||||
|
@ -1221,7 +1221,7 @@ void testSparkReverseOrderBug319(void) {
|
|||
eth.firePrimaryTriggerRise();
|
||||
schedulingQueue.executeAll(timeNow);
|
||||
|
||||
assertEqualsM("RPM#4", 3000, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F));
|
||||
assertEqualsM("RPM#4", 3000, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
assertEqualsM("out-of-order #7", 1, enginePins.coils[3].outOfOrder);
|
||||
|
||||
|
@ -1278,8 +1278,8 @@ void testMissedSpark299(void) {
|
|||
|
||||
assertEquals(3000, eth.engine.rpmCalculator.rpmValue);
|
||||
|
||||
setWholeTimingTable(3 PASS_ENGINE_PARAMETER);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
setWholeTimingTable(3 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
timeNow += MS2US(20);
|
||||
|
@ -1296,8 +1296,8 @@ void testMissedSpark299(void) {
|
|||
eth.firePrimaryTriggerFall();
|
||||
schedulingQueue.executeAll(timeNow);
|
||||
|
||||
setWholeTimingTable(-5 PASS_ENGINE_PARAMETER);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
setWholeTimingTable(-5 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
timeNow += MS2US(20);
|
||||
eth.firePrimaryTriggerRise();
|
||||
|
|
Loading…
Reference in New Issue