trigger and engine types -> enum class (#113)

* trigger type is enum class

* java tooling

* enum class engine_type_e

* enum class engine_type_e
This commit is contained in:
Matthew Kennedy 2023-06-01 13:47:49 -07:00 committed by GitHub
parent f9541aa1d1
commit 06b39dbb07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
128 changed files with 541 additions and 565 deletions

View File

@ -34,7 +34,7 @@ void setGy6139qmbDefaultEngineConfiguration() {
/**
* We treat the trigger as 8-1 toothed wheel
*/
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 8;
engineConfiguration->trigger.customSkippedToothCount = 1;

View File

@ -102,7 +102,7 @@ void m73engine() {
engineConfiguration->globalTriggerAngleOffset = 90;
setCrankOperationMode();
// todo: that's not right, should be 60/2 without VW
engineConfiguration->trigger.type = TT_60_2_VW;
engineConfiguration->trigger.type = trigger_type_e::TT_60_2_VW;
// this large engine seems to crank at around only 150 RPM? And happily idle at 400RPM?
engineConfiguration->cranking.rpm = 350;

View File

@ -102,7 +102,7 @@ void setEngineBMW_M73_microRusEfi() {
// do I have VR wires flipped?
engineConfiguration->trigger.type = TT_60_2_VW;
engineConfiguration->trigger.type = trigger_type_e::TT_60_2_VW;
//set tps_min 891
engineConfiguration->tpsMin = 891;

View File

@ -33,7 +33,7 @@ void setCamaro4() {
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
setCrankOperationMode();
engineConfiguration->trigger.type = TT_GM_24x;
engineConfiguration->trigger.type = trigger_type_e::TT_GM_24x;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_0; // PA0

View File

@ -19,7 +19,7 @@ void setCitroenBerlingoTU3JPConfiguration() {
* Base engine setting
*/
setCrankOperationMode();
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL_60_2;
engineConfiguration->globalTriggerAngleOffset = 114;
engineConfiguration->cylindersCount = 4;
engineConfiguration->displacement = 1.360;

View File

@ -67,7 +67,7 @@ void setDiscoveryPdm() {
// todo: should this be part of more default configurations?
void setFrankensoConfiguration() {
engineConfiguration->trigger.type = TT_ONE_PLUS_ONE;
engineConfiguration->trigger.type = trigger_type_e::TT_ONE_PLUS_ONE;
commonFrankensoAnalogInputs();
@ -229,7 +229,7 @@ void setEtbTestConfiguration() {
engineConfiguration->rpmHardLimit = 30000;
setCrankOperationMode();
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL_60_2;
engineConfiguration->ignitionPins[0] = Gpio::Unassigned;
@ -786,7 +786,7 @@ void setRotary() {
engineConfiguration->cylindersCount = 2;
engineConfiguration->firingOrder = FO_1_2;
engineConfiguration->trigger.type = TT_36_2_2_2;
engineConfiguration->trigger.type = trigger_type_e::TT_36_2_2_2;
// todo: fix UI to make this possible via TS
setTwoStrokeOperationMode();

View File

@ -19,7 +19,7 @@
#include "custom_engine.h"
void setDodgeNeon1995EngineConfiguration() {
engineConfiguration->trigger.type = TT_DODGE_NEON_1995;
engineConfiguration->trigger.type = trigger_type_e::TT_DODGE_NEON_1995;
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
@ -103,7 +103,7 @@ void setDodgeNeon1995EngineConfiguration() {
}
void setDodgeNeonNGCEngineConfiguration() {
engineConfiguration->trigger.type = TT_DODGE_NEON_2003_CAM;
engineConfiguration->trigger.type = trigger_type_e::TT_DODGE_NEON_2003_CAM;
// set global_trigger_offset_angle 38
engineConfiguration->globalTriggerAngleOffset = 38;

View File

@ -15,7 +15,7 @@
void setDodgeRam1996() {
setFrankensoConfiguration();
engineConfiguration->trigger.type = TT_DODGE_RAM;
engineConfiguration->trigger.type = trigger_type_e::TT_DODGE_RAM;
engineConfiguration->injector.flow = 243.6; // 23.2lb/h
engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003;

View File

@ -39,7 +39,7 @@ void setFordInline6() {
* We treat the trigger as 6/0 toothed wheel
*/
engineConfiguration->skippedWheelOnCam = true;
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 6;
engineConfiguration->trigger.customSkippedToothCount = 0;

View File

@ -73,7 +73,7 @@ void setFordAspireEngineConfiguration() {
setSingleCoilDwell();
engineConfiguration->ignitionMode = IM_ONE_COIL;
engineConfiguration->trigger.type = TT_FORD_ASPIRE;
engineConfiguration->trigger.type = trigger_type_e::TT_FORD_ASPIRE;
engineConfiguration->triggerInputDebugPins[0] = Gpio::C15;

View File

@ -66,7 +66,7 @@ static const uint8_t racingFestivaVeTable[16][16] = {
void setFordEscortGt() {
common079721_2351();
engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4;
engineConfiguration->trigger.type = trigger_type_e::TT_MAZDA_DOHC_1_4;
setDensoTODO(config);

View File

@ -24,7 +24,7 @@ static void setDefaultCustomMaps() {
void setHonda600() {
engineConfiguration->trigger.type = TT_HONDA_CBR_600;
engineConfiguration->trigger.type = trigger_type_e::TT_HONDA_CBR_600;
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
// upside down wiring

View File

@ -16,7 +16,7 @@ void setHondaK() {
engineConfiguration->displacement = 2.4;
engineConfiguration->firingOrder = FO_1_3_4_2;
engineConfiguration->engineSyncCam = SC_Exhaust_First;
engineConfiguration->trigger.type = TT_HONDA_K_CRANK_12_1;
engineConfiguration->trigger.type = trigger_type_e::TT_HONDA_K_CRANK_12_1;
engineConfiguration->globalTriggerAngleOffset = 675;
engineConfiguration->vvtMode[0] = VVT_HONDA_K_INTAKE;
@ -54,12 +54,12 @@ void setHondaK() {
*/
void setProteusHondaElement2003() {
setHondaK();
// engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
// engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
// engineConfiguration->trigger.customTotalToothCount = 12;
// engineConfiguration->trigger.customSkippedToothCount = 0;
// engineConfiguration->trigger.type = TT_HONDA_K_CAM_4_1; // cam as primary, ignoring crank
// engineConfiguration->trigger.type = trigger_type_e::TT_HONDA_K_CAM_4_1; // cam as primary, ignoring crank
// engineConfiguration->globalTriggerAngleOffset = 570;

View File

@ -73,7 +73,7 @@ static const uint8_t miataNA8_maf_advance_table[16][16] = { {/*0 engineLoad=1.2
#endif
static void commonMiataNa() {
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA;
engineConfiguration->trigger.type = trigger_type_e::TT_MAZDA_MIATA_NA;
engineConfiguration->engineChartSize = 100;
engineConfiguration->triggerInputPins[0] = Gpio::C6; // 2G YEL/BLU

View File

@ -92,7 +92,7 @@ void miataNAcommonEngineSettings() {
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
// Trigger
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA;
engineConfiguration->trigger.type = trigger_type_e::TT_MAZDA_MIATA_NA;
// Cranking
engineConfiguration->cranking.rpm = 400;

View File

@ -22,7 +22,7 @@
* http://rusefi.com/forum/viewtopic.php?f=3&t=1095
*
*
* See also TT_MAZDA_MIATA_VVT_TEST for trigger simulation
* See also trigger_type_e::TT_MAZDA_MIATA_VVT_TEST for trigger simulation
*
* Based on http://rusefi.com/wiki/index.php?title=Manual:Hardware_Frankenso_board#Default_Pinout
*
@ -251,7 +251,7 @@ static void setCommonMazdaNB() {
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
// Trigger
engineConfiguration->trigger.type = TT_MIATA_VVT;
engineConfiguration->trigger.type = trigger_type_e::TT_MIATA_VVT;
engineConfiguration->vvtMode[0] = VVT_MIATA_NB;
engineConfiguration->vvtOffsets[0] = 98;
@ -644,7 +644,7 @@ void setMiataNB2_Proteus_TCU() {
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_MAZDA);
strcpy(engineConfiguration->vehicleName, "TCU test");
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 10;
engineConfiguration->trigger.customSkippedToothCount = 0;
@ -778,7 +778,7 @@ void setMiataNB2_Hellen72() {
void setMiataNB2_Hellen72_36() {
setMiataNB2_Hellen72();
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_1;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL_36_1;
engineConfiguration->globalTriggerAngleOffset = 76;
}

View File

@ -15,7 +15,7 @@
void setMitsubishiConfiguration() {
engineConfiguration->trigger.type = TT_MITSUBISHI_4G93; // same trigger as 4G63?
engineConfiguration->trigger.type = trigger_type_e::TT_MITSUBISHI_4G93; // same trigger as 4G63?
engineConfiguration->cylindersCount = 4;
engineConfiguration->displacement = 1.800;

View File

@ -13,7 +13,7 @@
#include "nissan_primera.h"
void setNissanPrimeraEngineConfiguration() {
engineConfiguration->trigger.type = TT_NISSAN_SR20VE;
engineConfiguration->trigger.type = trigger_type_e::TT_NISSAN_SR20VE;
engineConfiguration->auxValves[0] = Gpio::E14;
engineConfiguration->auxValves[1] = Gpio::E12;

View File

@ -13,7 +13,7 @@
#define NISSAN_VQ_VVT_OFFSET 157
void setHellen121nissanQR() {
engineConfiguration->trigger.type = TT_NISSAN_QR25;
engineConfiguration->trigger.type = trigger_type_e::TT_NISSAN_QR25;
engineConfiguration->cylindersCount = 4;
engineConfiguration->firingOrder = FO_1_3_4_2;
@ -34,7 +34,7 @@ void setHellen121nissanQR() {
void setHellen121nissanVQ() {
#include "nissan_vq.lua"
engineConfiguration->trigger.type = TT_NISSAN_VQ35;
engineConfiguration->trigger.type = trigger_type_e::TT_NISSAN_VQ35;
setNissanMAF0031(config);

View File

@ -26,7 +26,7 @@ void setSachs() {
/**
* 50/2 trigger
*/
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 50;
engineConfiguration->trigger.customSkippedToothCount = 2;

View File

@ -15,7 +15,7 @@
#include "defaults.h"
void setSubaru2003Wrx() {
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 5;
engineConfiguration->trigger.customSkippedToothCount = 1;
@ -35,7 +35,7 @@ void setSubaru2003Wrx() {
* set engine_type 37
*/
void setSubaruEJ18_MRE() {
engineConfiguration->trigger.type = TT_SUBARU_7_WITHOUT_6;
engineConfiguration->trigger.type = trigger_type_e::TT_SUBARU_7_WITHOUT_6;
// engineConfiguration->isDoubleSolenoidIdle = true;
@ -65,7 +65,7 @@ void setSubaruEJ18_MRE() {
void setSubaruEG33Defaults() {
setCamOperationMode();
engineConfiguration->trigger.type = TT_SUBARU_SVX;
engineConfiguration->trigger.type = trigger_type_e::TT_SUBARU_SVX;
engineConfiguration->cylindersCount = 6;
setLeftRightBanksNeedBetterName();

View File

@ -16,10 +16,10 @@
// TEST_ENGINE
void setTestCamEngineConfiguration() {
engineConfiguration->trigger.type = TT_ONE_PLUS_ONE;
engineConfiguration->trigger.type = trigger_type_e::TT_ONE_PLUS_ONE;
setCamOperationMode();
// engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
// engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
// trigger_config_s *triggerConfig = &engineConfiguration->trigger;
// triggerConfig->customTotalToothCount = 60;
// triggerConfig->customSkippedToothCount = 0;
@ -50,7 +50,7 @@ void setTestCamEngineConfiguration() {
void setTestCrankEngineConfiguration() {
setTestCamEngineConfiguration();
engineConfiguration->trigger.type = TT_ONE;
engineConfiguration->trigger.type = trigger_type_e::TT_ONE;
setCrankOperationMode();
// this is related to 'setDefaultBaseEngine' having 'skippedWheelOnCam = true' which is a weird fact by itself
@ -76,7 +76,7 @@ void setTestDcWastegateConfiguration() {
void setTestVVTEngineConfiguration() {
setCrankOperationMode();
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 3;
engineConfiguration->trigger.customSkippedToothCount = 1;
@ -99,7 +99,7 @@ void setTestEngineIssue366both() {
engineConfiguration->trigger.customTotalToothCount = 2;
engineConfiguration->trigger.customSkippedToothCount = 1;
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
}
void setTestEngineIssue366rise() {
@ -110,7 +110,7 @@ void setTestEngineIssue366rise() {
#ifdef HARDWARE_CI
void setProteusAnalogPwmTest() {
// lowest cpu trigger possible
engineConfiguration->trigger.type = TT_ONE;
engineConfiguration->trigger.type = trigger_type_e::TT_ONE;
// Disable trigger stim
engineConfiguration->triggerSimulatorPins[0] = Gpio::Unassigned;

View File

@ -73,7 +73,7 @@ void setToyota_2jz_vics() {
common2jz();
setCrankOperationMode();
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_2;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL_36_2;
engineConfiguration->triggerInputPins[0] = Gpio::A5; // crank sensor
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned; // cam sensor will he handled by custom vtti code

View File

@ -26,7 +26,7 @@ void setVwAba() {
setCrankOperationMode();
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL_60_2;
engineConfiguration->mafAdcChannel = EFI_ADC_1;

View File

@ -16,7 +16,7 @@
static void commonPassatB6() {
setCrankOperationMode();
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL_60_2;
engineConfiguration->vvtMode[0] = VVT_BOSCH_QUICK_START;
engineConfiguration->map.sensor.type = MT_BOSCH_2_5;

View File

@ -53,7 +53,7 @@ void setDefaultBaseEngine() {
engineConfiguration->ALSMaxTPS = 5;
// Trigger
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL_60_2;
engineConfiguration->globalTriggerAngleOffset = 0;

View File

@ -66,42 +66,42 @@ void Engine::resetEngineSnifferIfInTestMode() {
trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode) {
switch (vvtMode) {
case VVT_INACTIVE:
return TT_ONE;
return trigger_type_e::TT_ONE;
case VVT_2JZ:
return TT_VVT_JZ;
return trigger_type_e::TT_VVT_JZ;
case VVT_MIATA_NB:
return TT_VVT_MIATA_NB;
return trigger_type_e::TT_VVT_MIATA_NB;
case VVT_BOSCH_QUICK_START:
return TT_VVT_BOSCH_QUICK_START;
return trigger_type_e::TT_VVT_BOSCH_QUICK_START;
case VVT_HONDA_K_EXHAUST:
return TT_HONDA_K_CAM_4_1;
return trigger_type_e::TT_HONDA_K_CAM_4_1;
case VVT_HONDA_K_INTAKE:
case VVT_FIRST_HALF:
case VVT_SECOND_HALF:
case VVT_MAP_V_TWIN:
return TT_ONE;
return trigger_type_e::TT_ONE;
case VVT_FORD_ST170:
return TT_FORD_ST170;
return trigger_type_e::TT_FORD_ST170;
case VVT_BARRA_3_PLUS_1:
return TT_VVT_BARRA_3_PLUS_1;
return trigger_type_e::TT_VVT_BARRA_3_PLUS_1;
case VVT_MAZDA_SKYACTIV:
return TT_VVT_MAZDA_SKYACTIV;
return trigger_type_e::TT_VVT_MAZDA_SKYACTIV;
case VVT_NISSAN_VQ:
return TT_VVT_NISSAN_VQ35;
return trigger_type_e::TT_VVT_NISSAN_VQ35;
case VVT_TOYOTA_4_1:
return TT_VVT_TOYOTA_4_1;
return trigger_type_e::TT_VVT_TOYOTA_4_1;
case VVT_MITSUBISHI_3A92:
return TT_VVT_MITSUBISHI_3A92;
return trigger_type_e::TT_VVT_MITSUBISHI_3A92;
case VVT_MITSUBISHI_6G75:
case VVT_NISSAN_MR:
return TT_NISSAN_MR18_CAM_VVT;
return trigger_type_e::TT_NISSAN_MR18_CAM_VVT;
case VVT_MITSUBISHI_4G9x:
return TT_MITSU_4G9x_CAM;
return trigger_type_e::TT_MITSU_4G9x_CAM;
case VVT_MITSUBISHI_4G63:
return TT_MITSU_4G63_CAM;
return trigger_type_e::TT_MITSU_4G63_CAM;
default:
firmwareError(ObdCode::OBD_PCM_Processor_Fault, "getVvtTriggerType for %s", getVvt_mode_e(vvtMode));
return TT_ONE; // we have to return something for the sake of -Werror=return-type
return trigger_type_e::TT_ONE; // we have to return something for the sake of -Werror=return-type
}
}

View File

@ -650,7 +650,7 @@ void loadConfiguration() {
#if EFI_INTERNAL_FLASH
if (SHOULD_IGNORE_FLASH() || IGNORE_FLASH_CONFIGURATION) {
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
engineConfiguration->engineType = engine_type_e::DEFAULT_ENGINE_TYPE;
resetConfigurationExt(engineConfiguration->engineType);
writeToFlashNow();
} else {
@ -660,7 +660,7 @@ void loadConfiguration() {
}
#else // not EFI_INTERNAL_FLASH
// This board doesn't load configuration, initialize the default
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
engineConfiguration->engineType = engine_type_e::DEFAULT_ENGINE_TYPE;
resetConfigurationExt(engineConfiguration->engineType);
#endif /* EFI_INTERNAL_FLASH */
@ -694,268 +694,268 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e
* And override them with engine-specific defaults
*/
switch (engineType) {
case MINIMAL_PINS:
case engine_type_e::MINIMAL_PINS:
// all basic settings are already set in prepareVoidConfiguration(), no need to set anything here
// nothing to do - we do it all in setBoardDefaultConfiguration
break;
#if EFI_UNIT_TEST
case TEST_ISSUE_366_BOTH:
case engine_type_e::TEST_ISSUE_366_BOTH:
setTestEngineIssue366both();
break;
case TEST_ISSUE_366_RISE:
case engine_type_e::TEST_ISSUE_366_RISE:
setTestEngineIssue366rise();
break;
#endif // EFI_UNIT_TEST
#if HW_MICRO_RUSEFI
case MRE_VW_B6:
case engine_type_e::MRE_VW_B6:
setMreVwPassatB6();
break;
case MRE_M111:
case engine_type_e::MRE_M111:
setM111EngineConfiguration();
break;
case MRE_SUBARU_EJ18:
case engine_type_e::MRE_SUBARU_EJ18:
setSubaruEJ18_MRE();
break;
case MRE_BOARD_NEW_TEST:
case engine_type_e::MRE_BOARD_NEW_TEST:
mreBoardNewTest();
break;
case BMW_M73_MRE:
case BMW_M73_MRE_SLAVE:
case engine_type_e::BMW_M73_MRE:
case engine_type_e::BMW_M73_MRE_SLAVE:
setEngineBMW_M73_microRusEfi();
break;
case MRE_MIATA_94_MAP:
case engine_type_e::MRE_MIATA_94_MAP:
setMiata94_MAP_MRE();
break;
case MRE_MIATA_NA6_MAP:
case engine_type_e::MRE_MIATA_NA6_MAP:
setMiataNA6_MAP_MRE();
break;
case MRE_BODY_CONTROL:
case engine_type_e::MRE_BODY_CONTROL:
mreBCM();
break;
#endif // HW_MICRO_RUSEFI
#if HW_PROTEUS
case WASTEGATE_PROTEUS_TEST:
case engine_type_e::WASTEGATE_PROTEUS_TEST:
proteusDcWastegateTest();
break;
case PROTEUS_GM_LS_4:
case engine_type_e::PROTEUS_GM_LS_4:
setProteusGmLs4();
break;
case PROTEUS_VW_B6:
case engine_type_e::PROTEUS_VW_B6:
setProteusVwPassatB6();
break;
case PROTEUS_QC_TEST_BOARD:
case engine_type_e::PROTEUS_QC_TEST_BOARD:
proteusBoardTest();
break;
case PROTEUS_LUA_DEMO:
case engine_type_e::PROTEUS_LUA_DEMO:
proteusLuaDemo();
break;
case PROTEUS_HARLEY:
case engine_type_e::PROTEUS_HARLEY:
proteusHarley();
break;
case PROTEUS_BMW_M73:
case engine_type_e::PROTEUS_BMW_M73:
setEngineBMW_M73_Proteus();
break;
case MIATA_PROTEUS_TCU:
case engine_type_e::MIATA_PROTEUS_TCU:
setMiataNB2_Proteus_TCU();
break;
case PROTEUS_HONDA_K:
case engine_type_e::PROTEUS_HONDA_K:
setProteusHondaElement2003();
break;
case PROTEUS_HONDA_OBD2A:
case engine_type_e::PROTEUS_HONDA_OBD2A:
setProteusHondaOBD2A();
break;
case PROTEUS_E65_6H_MAN_IN_THE_MIDDLE:
case engine_type_e::PROTEUS_E65_6H_MAN_IN_THE_MIDDLE:
setEngineProteusGearboxManInTheMiddle();
break;
case PROTEUS_MIATA_NA6:
case engine_type_e::PROTEUS_MIATA_NA6:
setMiataNa6_Proteus();
break;
case PROTEUS_MIATA_NB2:
case engine_type_e::PROTEUS_MIATA_NB2:
setMiataNB2_Proteus();
break;
#ifdef HARDWARE_CI
case PROTEUS_ANALOG_PWM_TEST:
case engine_type_e::PROTEUS_ANALOG_PWM_TEST:
setProteusAnalogPwmTest();
break;
#endif // HARDWARE_CI
#endif // HW_PROTEUS
#if HW_HELLEN
case HELLEN_128_MERCEDES_4_CYL:
case engine_type_e::HELLEN_128_MERCEDES_4_CYL:
setHellenMercedes128_4_cyl();
break;
case HELLEN_128_MERCEDES_6_CYL:
case engine_type_e::HELLEN_128_MERCEDES_6_CYL:
setHellenMercedes128_6_cyl();
break;
case HELLEN_128_MERCEDES_8_CYL:
case engine_type_e::HELLEN_128_MERCEDES_8_CYL:
setHellenMercedes128_8_cyl();
break;
case HELLEN_NB2:
case engine_type_e::HELLEN_NB2:
setMiataNB2_Hellen72();
break;
case HELLEN_NB2_36:
case engine_type_e::HELLEN_NB2_36:
setMiataNB2_Hellen72_36();
break;
case HELLEN_NA8_96:
case engine_type_e::HELLEN_NA8_96:
setHellenMiata96();
break;
case HELLEN_NB1:
case engine_type_e::HELLEN_NB1:
setHellenNB1();
break;
case HELLEN_121_NISSAN_4_CYL:
case engine_type_e::HELLEN_121_NISSAN_4_CYL:
setHellen121nissanQR();
break;
case HELLEN_121_NISSAN_6_CYL:
case engine_type_e::HELLEN_121_NISSAN_6_CYL:
setHellen121nissanVQ();
break;
case HELLEN_121_VAG_5_CYL:
case engine_type_e::HELLEN_121_VAG_5_CYL:
setHellen121Vag_5_cyl();
break;
case HELLEN_121_VAG_V6_CYL:
case engine_type_e::HELLEN_121_VAG_V6_CYL:
setHellen121Vag_v6_cyl();
break;
case HELLEN_121_VAG_VR6_CYL:
case engine_type_e::HELLEN_121_VAG_VR6_CYL:
setHellen121Vag_vr6_cyl();
break;
case HELLEN_121_VAG_8_CYL:
case engine_type_e::HELLEN_121_VAG_8_CYL:
setHellen121Vag_8_cyl();
break;
case HELLEN_121_VAG_4_CYL:
case HELLEN_55_BMW:
case HELLEN_88_BMW:
case HELLEN_134_BMW:
case HELLEN_154_VAG:
case engine_type_e::HELLEN_121_VAG_4_CYL:
case engine_type_e::HELLEN_55_BMW:
case engine_type_e::HELLEN_88_BMW:
case engine_type_e::HELLEN_134_BMW:
case engine_type_e::HELLEN_154_VAG:
break;
case HELLEN_154_HYUNDAI_COUPE_BK1:
case engine_type_e::HELLEN_154_HYUNDAI_COUPE_BK1:
setGenesisCoupeBK1();
break;
case HELLEN_154_HYUNDAI_COUPE_BK2:
case engine_type_e::HELLEN_154_HYUNDAI_COUPE_BK2:
setGenesisCoupeBK2();
break;
case HELLEN_NA6:
case engine_type_e::HELLEN_NA6:
setHellenNA6();
break;
case HELLEN_NA94:
case engine_type_e::HELLEN_NA94:
setHellenNA94();
break;
#endif // HW_HELLEN
#if HW_FRANKENSO
case DEFAULT_FRANKENSO:
case engine_type_e::DEFAULT_FRANKENSO:
setFrankensoConfiguration();
break;
case DISCOVERY_PDM:
case TEST_ENGINE:
case engine_type_e::DISCOVERY_PDM:
case engine_type_e::TEST_ENGINE:
setTestCamEngineConfiguration();
break;
case TEST_CRANK_ENGINE:
case engine_type_e::TEST_CRANK_ENGINE:
setTestCrankEngineConfiguration();
break;
case FRANKENSO_QA_ENGINE:
case engine_type_e::FRANKENSO_QA_ENGINE:
setFrankensoBoardTestConfiguration();
break;
case FRANKENSO_BMW_M73_F:
case engine_type_e::FRANKENSO_BMW_M73_F:
setBMW_M73_TwoCoilUnitTest();
break;
case BMW_M73_M:
case engine_type_e::BMW_M73_M:
setEngineBMW_M73_Manhattan();
break;
case DODGE_NEON_1995:
case engine_type_e::DODGE_NEON_1995:
setDodgeNeon1995EngineConfiguration();
break;
case DODGE_NEON_2003_CRANK:
case engine_type_e::DODGE_NEON_2003_CRANK:
setDodgeNeonNGCEngineConfiguration();
break;
case FORD_ASPIRE_1996:
case engine_type_e::FORD_ASPIRE_1996:
setFordAspireEngineConfiguration();
break;
case NISSAN_PRIMERA:
case engine_type_e::NISSAN_PRIMERA:
setNissanPrimeraEngineConfiguration();
break;
case FRANKENSO_MIATA_NA6_MAP:
case engine_type_e::FRANKENSO_MIATA_NA6_MAP:
setMiataNA6_MAP_Frankenso();
break;
case ETB_BENCH_ENGINE:
case engine_type_e::ETB_BENCH_ENGINE:
setEtbTestConfiguration();
break;
case L9779_BENCH_ENGINE:
case engine_type_e::L9779_BENCH_ENGINE:
setL9779TestConfiguration();
break;
case EEPROM_BENCH_ENGINE:
case engine_type_e::EEPROM_BENCH_ENGINE:
#if EFI_PROD_CODE
setEepromTestConfiguration();
#endif
break;
case TLE8888_BENCH_ENGINE:
case engine_type_e::TLE8888_BENCH_ENGINE:
setTle8888TestConfiguration();
break;
case FRANKENSO_MAZDA_MIATA_NA8:
case engine_type_e::FRANKENSO_MAZDA_MIATA_NA8:
setFrankensoMazdaMiataNA8Configuration();
break;
case MITSU_4G93:
case engine_type_e::MITSU_4G93:
setMitsubishiConfiguration();
break;
case FORD_INLINE_6_1995:
case engine_type_e::FORD_INLINE_6_1995:
setFordInline6();
break;
case GY6_139QMB:
case engine_type_e::GY6_139QMB:
setGy6139qmbDefaultEngineConfiguration();
break;
case HONDA_600:
case engine_type_e::HONDA_600:
setHonda600();
break;
case FORD_ESCORT_GT:
case engine_type_e::FORD_ESCORT_GT:
setFordEscortGt();
break;
case MIATA_1996:
case engine_type_e::MIATA_1996:
setFrankensteinMiata1996();
break;
case CITROEN_TU3JP:
case engine_type_e::CITROEN_TU3JP:
setCitroenBerlingoTU3JPConfiguration();
break;
case SUBARU_2003_WRX:
case engine_type_e::SUBARU_2003_WRX:
setSubaru2003Wrx();
break;
case DODGE_RAM:
case engine_type_e::DODGE_RAM:
setDodgeRam1996();
break;
case VW_ABA:
case engine_type_e::VW_ABA:
setVwAba();
break;
case FRANKENSO_MAZDA_MIATA_2003:
case engine_type_e::FRANKENSO_MAZDA_MIATA_2003:
setMazdaMiata2003EngineConfiguration();
break;
case MAZDA_MIATA_2003_NA_RAIL:
case engine_type_e::MAZDA_MIATA_2003_NA_RAIL:
setMazdaMiata2003EngineConfigurationNaFuelRail();
break;
case MAZDA_MIATA_2003_BOARD_TEST:
case engine_type_e::MAZDA_MIATA_2003_BOARD_TEST:
setMazdaMiata2003EngineConfigurationBoardTest();
break;
case TEST_ENGINE_VVT:
case engine_type_e::TEST_ENGINE_VVT:
setTestVVTEngineConfiguration();
break;
case TEST_DC_WASTEGATE_DISCOVERY:
case engine_type_e::TEST_DC_WASTEGATE_DISCOVERY:
setTestDcWastegateConfiguration();
break;
case SACHS:
case engine_type_e::SACHS:
setSachs();
break;
case CAMARO_4:
case engine_type_e::CAMARO_4:
setCamaro4();
break;
case TOYOTA_2JZ_GTE_VVTi:
case engine_type_e::TOYOTA_2JZ_GTE_VVTi:
setToyota_2jz_vics();
break;
case TEST_33816:
case engine_type_e::TEST_33816:
setTest33816EngineConfiguration();
break;
case TEST_100:
case TEST_101:
case TEST_102:
case TEST_ROTARY:
case engine_type_e::TEST_100:
case engine_type_e::TEST_101:
case engine_type_e::TEST_102:
case engine_type_e::TEST_ROTARY:
setRotary();
break;
#endif // HW_FRANKENSO
#ifdef HW_SUBARU_EG33
case SUBARUEG33_DEFAULTS:
case engine_type_e::SUBARUEG33_DEFAULTS:
setSubaruEG33Defaults();
break;
#endif //HW_SUBARU_EG33

View File

@ -16,7 +16,7 @@
/**
* http://rusefi.com/wiki/index.php?title=Manual:Engine_Type
*/
typedef enum __attribute__ ((__packed__)) {
enum class engine_type_e : uint32_t {
DEFAULT_FRANKENSO = 0,
MIATA_PROTEUS_TCU = 1,
@ -219,11 +219,7 @@ typedef enum __attribute__ ((__packed__)) {
TEST_100 = 100,
TEST_101 = 101,
TEST_102 = 102,
// java code generator handles this value in a special way
// also looks like 2 enums are either 1 byte or 4 bytes
Force_4_bytes_size_engine_type = 70000,
} engine_type_e;
};
/**
* https://rusefi.com//wiki/index.php?title=Manual:Debug_fields
@ -298,8 +294,7 @@ typedef enum __attribute__ ((__packed__)) {
/**
* @see http://rusefi.com/wiki/index.php?title=Manual:Software:Trigger
*/
typedef enum {
enum class trigger_type_e : uint32_t {
TT_TOOTHED_WHEEL = 0,
TT_FORD_ASPIRE = 1,
TT_DODGE_NEON_1995 = 2,
@ -509,12 +504,7 @@ typedef enum {
// Another point: once you add a new trigger, run get_trigger_images.bat which would run fome_test.exe from unit_tests
//
TT_UNUSED = 75, // this is used if we want to iterate over all trigger types
// java code generator handles this value in a special way
// also looks like 2 enums are either 1 byte or 4 bytes
Force_4_bytes_size_trigger_type = 70000,
} trigger_type_e; // TriggerProcessor.java has this "trigger_type_e" name hard-coded!
};
typedef enum {
TS_DEBUG_MODE = 0,

View File

@ -492,7 +492,7 @@ void executeTSCommand(uint16_t subsystem, uint16_t index) {
case TS_SET_DEFAULT_ENGINE:
fatalErrorForPresetApply();
setEngineType(DEFAULT_ENGINE_TYPE);
setEngineType(engine_type_e::DEFAULT_ENGINE_TYPE);
break;
case 0x79:

View File

@ -70,12 +70,12 @@ operation_mode_e lookupOperationMode() {
// this is related to 'knownOperationMode' flag
static bool doesTriggerImplyOperationMode(trigger_type_e type) {
switch (type) {
case TT_TOOTHED_WHEEL:
case TT_ONE:
case TT_3_1_CAM:
case TT_36_2_2_2: // TODO: should this one be in this list?
case TT_TOOTHED_WHEEL_60_2:
case TT_TOOTHED_WHEEL_36_1:
case trigger_type_e::TT_TOOTHED_WHEEL:
case trigger_type_e::TT_ONE:
case trigger_type_e::TT_3_1_CAM:
case trigger_type_e::TT_36_2_2_2: // TODO: should this one be in this list?
case trigger_type_e::TT_TOOTHED_WHEEL_60_2:
case trigger_type_e::TT_TOOTHED_WHEEL_36_1:
// These modes could be either cam or crank speed
return false;
default:

View File

@ -302,7 +302,7 @@ void readFromFlash() {
efiPrintf("Need to reset flash to default due to CRC mismatch");
[[fallthrough]];
case FlashState::BlankChip:
resetConfigurationExt(DEFAULT_ENGINE_TYPE);
resetConfigurationExt(engine_type_e::DEFAULT_ENGINE_TYPE);
break;
case FlashState::IncompatibleVersion:
// Preserve engine type from old config

View File

@ -698,19 +698,24 @@ void setDateTime(const char * const isoDateTime) {
#endif // ! EFI_UNIT_TEST
void setEngineType(int value) {
setEngineType((engine_type_e)value);
}
void setEngineType(engine_type_e value) {
{
#if EFI_PROD_CODE
chibios_rt::CriticalSectionLocker csl;
#endif // EFI_PROD_CODE
engineConfiguration->engineType = (engine_type_e)value;
resetConfigurationExt((engine_type_e)value);
engineConfiguration->engineType = value;
resetConfigurationExt(value);
engine->resetEngineSnifferIfInTestMode();
#if EFI_INTERNAL_FLASH
writeToFlashNow();
#endif // EFI_INTERNAL_FLASH
}
incrementGlobalConfigurationVersion();
#if ! EFI_UNIT_TEST
#endif // ! EFI_UNIT_TEST

View File

@ -15,6 +15,7 @@ void printConfiguration(const engine_configuration_s *engineConfiguration);
void scheduleStopEngine(void);
void setEngineType(int value);
void setEngineType(engine_type_e value);
void readPin(const char *pinName);
void printDateTime();

View File

@ -503,7 +503,7 @@ static void add4cylblock(int off, TriggerWaveform *s) {
s->addEvent720(174 + off + 2, false, TriggerWheel::T_SECONDARY);
}
// TT_JEEP_4_CYL
// trigger_type_e::TT_JEEP_4_CYL
void initJeep_XJ_4cyl_2500(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::RiseOnly);
s->isSynchronizationNeeded = false;

View File

@ -101,7 +101,7 @@ static int gm_tooth_pair(float startAngle, bool isShortLong, TriggerWaveform* s,
}
/**
* TT_GM_24x and TT_GM_24x_2
* trigger_type_e::TT_GM_24x and trigger_type_e::TT_GM_24x_2
* https://www.mediafire.com/?40mfgeoe4ctti
* http://www.ls1gto.com/forums/archive/index.php/t-190549.htm
* http://www.ls2.com/forums/showthread.php/834483-LS-Timing-Reluctor-Wheels-Explained
@ -153,7 +153,7 @@ static void initGmLS24(TriggerWaveform *s, float shortToothWidth) {
}
}
// TT_GM_24x
// trigger_type_e::TT_GM_24x
void initGmLS24_5deg(TriggerWaveform *s) {
initGmLS24(s, 5);
@ -165,7 +165,7 @@ void initGmLS24_5deg(TriggerWaveform *s) {
s->tdcPosition = 50;
}
// TT_GM_24x_2
// trigger_type_e::TT_GM_24x_2
void initGmLS24_3deg(TriggerWaveform *s) {
initGmLS24(s, 3);

View File

@ -75,7 +75,7 @@ static void kseriesTooth(TriggerWaveform* s, float end) {
s->addEvent360(end , false, TriggerWheel::T_PRIMARY);
}
// TT_HONDA_K_CRANK_12_1
// trigger_type_e::TT_HONDA_K_CRANK_12_1
void configureHondaK_12_1(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CRANK_SENSOR, SyncEdge::RiseOnly);

View File

@ -56,7 +56,7 @@ void initializeMazdaMiataNaShape(TriggerWaveform *s) {
s->useOnlyPrimaryForSync = true;
}
// TT_MIATA_VVT
// trigger_type_e::TT_MIATA_VVT
void initializeMazdaMiataNb2Crank(TriggerWaveform *s) {
/**
* Note how we use 0..180 range while defining FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR trigger

View File

@ -10,7 +10,7 @@
#include "trigger_misc.h"
#include "trigger_universal.h"
// TT_FIAT_IAW_P8
// trigger_type_e::TT_FIAT_IAW_P8
void configureFiatIAQ_P8(TriggerWaveform * s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::Rise);
@ -25,7 +25,7 @@ void configureFiatIAQ_P8(TriggerWaveform * s) {
s->setTriggerSynchronizationGap(3);
}
// TT_TRI_TACH
// trigger_type_e::TT_TRI_TACH
void configureTriTach(TriggerWaveform * s) {
s->initialize(FOUR_STROKE_CRANK_SENSOR, SyncEdge::RiseOnly);

View File

@ -64,7 +64,7 @@ static void addMitsu93(TriggerWaveform *s, bool addSecondary) {
}
/**
* TT_MITSUBISHI_4G93 = 11
* trigger_type_e::TT_MITSUBISHI_4G93 = 11
*/
void initializeMitsubishi4G93(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::Fall);

View File

@ -30,13 +30,13 @@ static void commonRenix(TriggerWaveform *s) {
s->addEventAngle(s->getCycleDuration(), false);
}
// TT_RENIX_44_2_2
// trigger_type_e::TT_RENIX_44_2_2
void initializeRenix44_2_2(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR, SyncEdge::RiseOnly);
commonRenix(s);
}
// TT_RENIX_66_2_2_2
// trigger_type_e::TT_RENIX_66_2_2_2
void initializeRenix66_2_2(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_THREE_TIMES_CRANK_SENSOR, SyncEdge::RiseOnly);
commonRenix(s);

View File

@ -401,165 +401,165 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
shapeDefinitionError = false;
switch (triggerConfig.TriggerType.type) {
case TT_TOOTHED_WHEEL:
case trigger_type_e::TT_TOOTHED_WHEEL:
initializeSkippedToothTrigger(this, triggerConfig.TriggerType.customTotalToothCount,
triggerConfig.TriggerType.customSkippedToothCount, triggerOperationMode, SyncEdge::RiseOnly);
break;
case TT_MAZDA_MIATA_NA:
case trigger_type_e::TT_MAZDA_MIATA_NA:
initializeMazdaMiataNaShape(this);
break;
case TT_MITSUBISHI_MESS:
case trigger_type_e::TT_MITSUBISHI_MESS:
initializeMitsubishi4gMess(this);
break;
case TT_MAZDA_MIATA_VVT_TEST:
case trigger_type_e::TT_MAZDA_MIATA_VVT_TEST:
initializeMazdaMiataVVtTestShape(this);
break;
case TT_SUZUKI_G13B:
case trigger_type_e::TT_SUZUKI_G13B:
initializeSuzukiG13B(this);
break;
case TT_FORD_TFI_PIP:
case trigger_type_e::TT_FORD_TFI_PIP:
configureFordPip(this);
break;
case TT_FORD_ST170:
case trigger_type_e::TT_FORD_ST170:
configureFordST170(this);
break;
case TT_VVT_MIATA_NB:
case trigger_type_e::TT_VVT_MIATA_NB:
initializeMazdaMiataVVtCamShape(this);
break;
case TT_RENIX_66_2_2_2:
case trigger_type_e::TT_RENIX_66_2_2_2:
initializeRenix66_2_2(this);
break;
case TT_RENIX_44_2_2:
case trigger_type_e::TT_RENIX_44_2_2:
initializeRenix44_2_2(this);
break;
case TT_MIATA_VVT:
case trigger_type_e::TT_MIATA_VVT:
initializeMazdaMiataNb2Crank(this);
break;
case TT_DODGE_NEON_1995:
case TT_DODGE_NEON_1995_ONLY_CRANK:
case trigger_type_e::TT_DODGE_NEON_1995:
case trigger_type_e::TT_DODGE_NEON_1995_ONLY_CRANK:
configureNeon1995TriggerWaveformOnlyCrank(this);
break;
case TT_DODGE_STRATUS:
case trigger_type_e::TT_DODGE_STRATUS:
configureDodgeStratusTriggerWaveform(this);
break;
case TT_DODGE_NEON_2003_CAM:
case trigger_type_e::TT_DODGE_NEON_2003_CAM:
configureNeon2003TriggerWaveformCam(this);
break;
case TT_DODGE_NEON_2003_CRANK:
case trigger_type_e::TT_DODGE_NEON_2003_CRANK:
configureNeon2003TriggerWaveformCam(this);
// configureNeon2003TriggerWaveformCrank(triggerShape);
break;
case TT_FORD_ASPIRE:
case trigger_type_e::TT_FORD_ASPIRE:
configureFordAspireTriggerWaveform(this);
break;
case TT_VVT_NISSAN_VQ35:
case trigger_type_e::TT_VVT_NISSAN_VQ35:
initializeNissanVQvvt(this);
break;
case TT_VVT_MITSUBISHI_3A92:
case trigger_type_e::TT_VVT_MITSUBISHI_3A92:
initializeVvt3A92(this);
break;
case TT_VVT_TOYOTA_4_1:
case trigger_type_e::TT_VVT_TOYOTA_4_1:
initializeSkippedToothTrigger(this, 4, 1, triggerOperationMode, SyncEdge::RiseOnly);
setTriggerSynchronizationGap3(/*gapIndex*/0, /*from*/1.60, 2.40);
setTriggerSynchronizationGap3(/*gapIndex*/1, /*from*/0.75, 1.25);
break;
case TT_VVT_MITSUBISHI_6G75:
case TT_NISSAN_QR25:
case trigger_type_e::TT_VVT_MITSUBISHI_6G75:
case trigger_type_e::TT_NISSAN_QR25:
initializeNissanQR25crank(this);
break;
case TT_NISSAN_VQ30:
case trigger_type_e::TT_NISSAN_VQ30:
initializeNissanVQ30cam(this);
break;
case TT_NISSAN_VQ35:
case trigger_type_e::TT_NISSAN_VQ35:
initializeNissanVQ35crank(this);
break;
case TT_NISSAN_MR18_CRANK:
case trigger_type_e::TT_NISSAN_MR18_CRANK:
initializeNissanMR18crank(this);
break;
case TT_NISSAN_MR18_CAM_VVT:
case trigger_type_e::TT_NISSAN_MR18_CAM_VVT:
initializeNissanMRvvt(this);
break;
case TT_KAWA_KX450F:
case trigger_type_e::TT_KAWA_KX450F:
configureKawaKX450F(this);
break;
case TT_SKODA_FAVORIT:
case trigger_type_e::TT_SKODA_FAVORIT:
setSkodaFavorit(this);
break;
case TT_GM_60_2_2_2:
case trigger_type_e::TT_GM_60_2_2_2:
configureGm60_2_2_2(this);
break;
case TT_GM_7X:
case trigger_type_e::TT_GM_7X:
configureGmTriggerWaveform(this);
break;
case TT_MAZDA_DOHC_1_4:
case trigger_type_e::TT_MAZDA_DOHC_1_4:
configureMazdaProtegeLx(this);
break;
case TT_ONE_PLUS_ONE:
case trigger_type_e::TT_ONE_PLUS_ONE:
configureOnePlusOne(this);
break;
case TT_3_1_CAM:
case trigger_type_e::TT_3_1_CAM:
configure3_1_cam(this);
break;
case TT_MERCEDES_2_SEGMENT:
case trigger_type_e::TT_MERCEDES_2_SEGMENT:
setMercedesTwoSegment(this);
break;
case TT_ONE:
case trigger_type_e::TT_ONE:
initializeSkippedToothTrigger(this, 1, 0, triggerOperationMode, SyncEdge::Rise);
break;
case TT_MAZDA_SOHC_4:
case trigger_type_e::TT_MAZDA_SOHC_4:
configureMazdaProtegeSOHC(this);
break;
case TT_DAIHATSU:
case trigger_type_e::TT_DAIHATSU:
configureDaihatsu4(this);
break;
case TT_VVT_JZ:
case trigger_type_e::TT_VVT_JZ:
initializeSkippedToothTrigger(this, 3, 0, triggerOperationMode, SyncEdge::RiseOnly);
break;
case TT_36_2_1_1:
case trigger_type_e::TT_36_2_1_1:
initialize36_2_1_1(this);
break;
case TT_36_2_1:
case trigger_type_e::TT_36_2_1:
initialize36_2_1(this);
break;
case TT_TOOTHED_WHEEL_32_2:
case trigger_type_e::TT_TOOTHED_WHEEL_32_2:
initializeSkippedToothTrigger(this, 32, 2, triggerOperationMode, SyncEdge::RiseOnly);
// todo: why is this 32/2 asking for third gap while 60/2 is happy with just two gaps?
// method above sets second gap, here we add third
@ -567,139 +567,139 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
setThirdTriggerSynchronizationGap(1);
break;
case TT_TOOTHED_WHEEL_60_2:
case trigger_type_e::TT_TOOTHED_WHEEL_60_2:
initializeSkippedToothTrigger(this, 60, 2, triggerOperationMode, SyncEdge::RiseOnly);
break;
case TT_TOOTHED_WHEEL_36_2:
case trigger_type_e::TT_TOOTHED_WHEEL_36_2:
initializeSkippedToothTrigger(this, 36, 2, triggerOperationMode, SyncEdge::RiseOnly);
setTriggerSynchronizationGap3(/*gapIndex*/0, /*from*/1.6, 3.5);
setTriggerSynchronizationGap3(/*gapIndex*/1, /*from*/0.7, 1.3); // second gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise
break;
case TT_60_2_VW:
case trigger_type_e::TT_60_2_VW:
setVwConfiguration(this);
break;
case TT_TOOTHED_WHEEL_36_1:
case trigger_type_e::TT_TOOTHED_WHEEL_36_1:
initializeSkippedToothTrigger(this, 36, 1, triggerOperationMode, SyncEdge::RiseOnly);
break;
case TT_VVT_BOSCH_QUICK_START:
case trigger_type_e::TT_VVT_BOSCH_QUICK_START:
configureQuickStartSenderWheel(this);
break;
case TT_VVT_BARRA_3_PLUS_1:
case trigger_type_e::TT_VVT_BARRA_3_PLUS_1:
configureBarra3plus1cam(this);
break;
case TT_HONDA_K_CAM_4_1:
case trigger_type_e::TT_HONDA_K_CAM_4_1:
configureHondaK_4_1(this);
break;
case TT_HONDA_K_CRANK_12_1:
case trigger_type_e::TT_HONDA_K_CRANK_12_1:
configureHondaK_12_1(this);
break;
case TT_SUBARU_EZ30:
case trigger_type_e::TT_SUBARU_EZ30:
initializeSubaruEZ30(this);
break;
case TT_VVT_MAZDA_SKYACTIV:
case trigger_type_e::TT_VVT_MAZDA_SKYACTIV:
initializeMazdaSkyactivCam(this);
break;
case TT_BENELLI_TRE:
case trigger_type_e::TT_BENELLI_TRE:
configureBenelli(this);
break;
case TT_MITSU_4G63_CAM:
case trigger_type_e::TT_MITSU_4G63_CAM:
initializeMitsubishi4g63Cam(this);
break;
case TT_MITSU_4G9x_CAM:
case trigger_type_e::TT_MITSU_4G9x_CAM:
initializeMitsubishi4g9xCam(this);
break;
case TT_1_16:
case trigger_type_e::TT_1_16:
configureOnePlus16(this);
break;
case TT_HONDA_CBR_600:
case trigger_type_e::TT_HONDA_CBR_600:
configureHondaCbr600(this);
break;
case TT_CHRYSLER_NGC_36_2_2:
case trigger_type_e::TT_CHRYSLER_NGC_36_2_2:
configureChryslerNGC_36_2_2(this);
break;
case TT_MITSUBISHI_4G93:
case trigger_type_e::TT_MITSUBISHI_4G93:
initializeMitsubishi4G93(this);
break;
case TT_DODGE_RAM:
case trigger_type_e::TT_DODGE_RAM:
initDodgeRam(this);
break;
case TT_JEEP_4_CYL:
case trigger_type_e::TT_JEEP_4_CYL:
initJeep_XJ_4cyl_2500(this);
break;
case TT_JEEP_18_2_2_2:
case trigger_type_e::TT_JEEP_18_2_2_2:
initJeep18_2_2_2(this);
break;
case TT_SUBARU_7_6:
case trigger_type_e::TT_SUBARU_7_6:
initializeSubaru7_6(this);
break;
case TT_36_2_2_2:
case trigger_type_e::TT_36_2_2_2:
initialize36_2_2_2(this);
break;
case TT_2JZ_3_34:
case trigger_type_e::TT_2JZ_3_34:
initialize2jzGE3_34_simulation_shape(this);
break;
case TT_12_TOOTH_CRANK:
case trigger_type_e::TT_12_TOOTH_CRANK:
configure12ToothCrank(this);
break;
case TT_NISSAN_SR20VE:
case trigger_type_e::TT_NISSAN_SR20VE:
initializeNissanSR20VE_4(this);
break;
case TT_ROVER_K:
case trigger_type_e::TT_ROVER_K:
initializeRoverK(this);
break;
case TT_FIAT_IAW_P8:
case trigger_type_e::TT_FIAT_IAW_P8:
configureFiatIAQ_P8(this);
break;
case TT_TRI_TACH:
case trigger_type_e::TT_TRI_TACH:
configureTriTach(this);
break;
case TT_GM_24x:
case trigger_type_e::TT_GM_24x:
initGmLS24_5deg(this);
break;
case TT_GM_24x_2:
case trigger_type_e::TT_GM_24x_2:
initGmLS24_3deg(this);
break;
case TT_SUBARU_7_WITHOUT_6:
case trigger_type_e::TT_SUBARU_7_WITHOUT_6:
initializeSubaruOnly7(this);
break;
case TT_SUBARU_SVX:
case trigger_type_e::TT_SUBARU_SVX:
initializeSubaru_SVX(this);
break;
case TT_SUBARU_SVX_CRANK_1:
case trigger_type_e::TT_SUBARU_SVX_CRANK_1:
initializeSubaru_SVX(this);
break;
case TT_SUBARU_SVX_CAM_VVT:
case trigger_type_e::TT_SUBARU_SVX_CAM_VVT:
initializeSubaru_SVX(this);
break;

View File

@ -708,7 +708,7 @@ void triggerInfo(void) {
getTrigger_type_e(engineConfiguration->trigger.type), engineConfiguration->trigger.type,
getSyncEdge(TRIGGER_WAVEFORM(syncEdge)), TRIGGER_WAVEFORM(tdcPosition));
if (engineConfiguration->trigger.type == TT_TOOTHED_WHEEL) {
if (engineConfiguration->trigger.type == trigger_type_e::TT_TOOTHED_WHEEL) {
efiPrintf("total %d/skipped %d", engineConfiguration->trigger.customTotalToothCount,
engineConfiguration->trigger.customSkippedToothCount);
}

View File

@ -639,7 +639,7 @@ bool TriggerDecoderBase::isSyncPoint(const TriggerWaveform& triggerShape, trigge
// Instead of detecting short/long, this logic first checks for "maybe short" and "maybe long",
// then simply tests longer vs. shorter instead of absolute value.
if (triggerType == TT_MIATA_VVT) {
if (triggerType == trigger_type_e::TT_MIATA_VVT) {
auto secondGap = (float)toothDurations[1] / toothDurations[2];
bool currentGapOk = isInRange(triggerShape.syncronizationRatioFrom[0], (float)triggerSyncGapRatio, triggerShape.syncronizationRatioTo[0]);

Binary file not shown.

View File

@ -83,9 +83,6 @@ public class ParseState implements DefinitionsState {
if (stringValueMap == null)
return null;
for (Value value : stringValueMap.values()) {
if (value.isForceSize())
continue;
if (isNumeric(value.getValue())) {
valueNameById.put(value.getIntValue(), value.getName());
} else {

Binary file not shown.

View File

@ -12,10 +12,6 @@ import java.util.List;
import java.util.Map;
public class ToJavaEnum {
public static final String FORCE_2_BYTES_SIZE = "Force_2_bytes_size";
public static final String FORCE_4_BYTES_SIZE = "Force_4_bytes_size";
public static void main(String[] args) throws IOException {
InvokeReader invokeReader = new InvokeReader(args).invoke();
String outputPath = invokeReader.getOutputPath();
@ -61,9 +57,7 @@ public class ToJavaEnum {
int index = 0;
for (Value value : sorted) {
int numericValue = value.getIntValueMaybeResolve(registry);
if (index != numericValue
&& !value.getName().startsWith(FORCE_2_BYTES_SIZE)
&& !value.getName().startsWith(FORCE_4_BYTES_SIZE))
if (index != numericValue)
throw new IllegalStateException("Got explicit ordinal " + numericValue + " instead of ordinal " + index + " in " + value);
sb.append("\t" + value.getName() + ",\n");
index++;

View File

@ -110,9 +110,6 @@ public class VariableRegistry {
TreeMap<Integer, String> valueNameById = new TreeMap<>();
for (Value value : stringValueMap.values()) {
if (value.isForceSize())
continue;
if (isNumeric(value.getValue())) {
valueNameById.put(value.getIntValue(), value.getName());
} else {

View File

@ -4,9 +4,6 @@ import com.rusefi.VariableRegistry;
import java.util.Objects;
import static com.rusefi.ToJavaEnum.FORCE_2_BYTES_SIZE;
import static com.rusefi.ToJavaEnum.FORCE_4_BYTES_SIZE;
public class Value implements Comparable<Value> {
private final String name;
private final String value;
@ -16,10 +13,6 @@ public class Value implements Comparable<Value> {
this.value = value;
}
public boolean isForceSize() {
return getName().startsWith(FORCE_2_BYTES_SIZE) || getName().startsWith(FORCE_4_BYTES_SIZE);
}
public String getName() {
return name;
}

View File

@ -26,7 +26,6 @@ public class EnumToStringTest {
assertTrue(isKeyValueLine("MIN"));
assertTrue(isKeyValueLine("MIN = 2,"));
assertTrue(isKeyValueLine("MIN = -3,"));
assertTrue(isKeyValueLine("Force_4_bytes_size_operation_mode_e = ENUM_32_BITS,"));
assertTrue(isKeyValueLine("MIN = 0x02,"));
assertTrue(isKeyValueLine("MIN = 0xa2,"));
assertTrue(isKeyValueLine("MIN = 0xB2,"));

View File

@ -206,7 +206,7 @@ void EngineTestHelper::fireTriggerEventsWithDuration(float durationMs) {
/**
* Sends specified number of rise/fall trigger events, with specified amount of time between those.
*
* This is helpful for TT_ONE trigger wheel decoder and probably other decoders as well.
* This is helpful for trigger_type_e::TT_ONE trigger wheel decoder and probably other decoders as well.
*/
void EngineTestHelper::fireTriggerEvents2(int count, float durationMs) {
for (int i = 0; i < count; i++) {
@ -388,7 +388,7 @@ void EngineTestHelper::executeUntil(int timeUs) {
void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injectionMode) {
setCamOperationMode();
setupSimpleTestEngineWithMaf(eth, injectionMode, TT_ONE);
setupSimpleTestEngineWithMaf(eth, injectionMode, trigger_type_e::TT_ONE);
}
void setVerboseTrigger(bool isEnabled) {

View File

@ -2,7 +2,7 @@
#include "fuel_math.h"
TEST(Actuators, AntiLag) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->antiLagEnabled = true;

View File

@ -12,7 +12,7 @@ TEST(BoostControl, Setpoint) {
EXPECT_CALL(targetMap, getValue(_, _))
.WillRepeatedly([](float xRpm, float tps) { return tps; });
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->boostType = CLOSED_LOOP;
BoostController bc;
@ -32,7 +32,7 @@ TEST(BoostControl, Setpoint) {
}
TEST(BoostControl, ObservePlant) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
BoostController bc;
@ -53,7 +53,7 @@ TEST(BoostControl, OpenLoop) {
EXPECT_CALL(openMap, getValue(_, _))
.WillRepeatedly([](float xRpm, float tps) { return tps; });
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
BoostController bc;
@ -68,7 +68,7 @@ TEST(BoostControl, OpenLoop) {
}
TEST(BoostControl, TestClosedLoop) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
BoostController bc;
@ -107,7 +107,7 @@ TEST(BoostControl, TestClosedLoop) {
}
TEST(BoostControl, SetOutput) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->isBoostControlEnabled = true;

View File

@ -21,7 +21,7 @@ using ::testing::StrictMock;
TEST(etb, initializationNoPedal) {
StrictMock<MockEtb> mocks[ETB_COUNT];
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
for (int i = 0; i < ETB_COUNT; i++) {
engine->etbControllers[i] = &mocks[i];
@ -37,7 +37,7 @@ TEST(etb, initializationNoPedal) {
TEST(etb, initializationMissingThrottle) {
StrictMock<MockEtb> mocks[ETB_COUNT];
EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
engineConfiguration->etbFunctions[0] = DC_None;
engineConfiguration->etbFunctions[1] = DC_None;
});
@ -63,7 +63,7 @@ TEST(etb, initializationSingleThrottle) {
EXPECT_CALL(mocks[0], isEtbMode())
.WillOnce(Return(TRUE));
EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
engineConfiguration->etbFunctions[0] = DC_Throttle1;
engineConfiguration->etbFunctions[1] = DC_None;
});
@ -91,7 +91,7 @@ TEST(etb, initializationSingleThrottleInSecondSlot) {
EXPECT_CALL(mocks[1], isEtbMode())
.WillOnce(Return(TRUE));
EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
engineConfiguration->etbFunctions[0] = DC_None;
engineConfiguration->etbFunctions[1] = DC_Throttle1;
});
@ -121,7 +121,7 @@ TEST(etb, initializationDualThrottle) {
EXPECT_CALL(mocks[1], isEtbMode())
.WillOnce(Return(TRUE));
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
for (int i = 0; i < ETB_COUNT; i++) {
engine->etbControllers[i] = &mocks[i];
@ -152,7 +152,7 @@ TEST(etb, initializationWastegate) {
EXPECT_CALL(mocks[0], isEtbMode())
.WillOnce(Return(false));
EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
engineConfiguration->etbFunctions[0] = DC_Wastegate;
engineConfiguration->etbFunctions[1] = DC_None;
});
@ -234,7 +234,7 @@ TEST(etb, initializationNoThrottles) {
// This tests the case where you don't want an ETB, and expect everything to go fine
EtbController duts[2];
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
for (int i = 0; i < ETB_COUNT; i++) {
engine->etbControllers[i] = &duts[i];
@ -257,7 +257,7 @@ TEST(etb, initializationNoThrottles) {
TEST(etb, idlePlumbing) {
StrictMock<MockEtb> mocks[ETB_COUNT];
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
Sensor::setMockValue(SensorType::AcceleratorPedal, 50.0f, true);
@ -271,7 +271,7 @@ TEST(etb, idlePlumbing) {
}
TEST(etb, testSetpointOnlyPedal) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
EtbController etb;
@ -330,7 +330,7 @@ TEST(etb, testSetpointOnlyPedal) {
}
TEST(etb, setpointSecondThrottleTrim) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Mock pedal map that's just passthru pedal -> target
StrictMock<MockVp3d> pedalMap;
@ -357,7 +357,7 @@ TEST(etb, setpointSecondThrottleTrim) {
}
TEST(etb, setpointIdle) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Use ETB for idle, but don't give it any range (yet)
engineConfiguration->etbIdleThrottleRange = 0;
@ -413,7 +413,7 @@ TEST(etb, setpointIdle) {
}
TEST(etb, setpointRevLimit) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Configure 5000 limit start, with 750 rpm taper
engineConfiguration->etbRevLimitStart = 5000;
@ -488,7 +488,7 @@ TEST(etb, setpointWastegateController) {
}
TEST(etb, setpointLuaAdder) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Must have TPS & PPS initialized for ETB setup
Sensor::setMockValue(SensorType::Tps1Primary, 0);
@ -570,7 +570,7 @@ TEST(etb, etbTpsSensor) {
}
TEST(etb, setOutputInvalid) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Redundant TPS & accelerator pedal required for init
Sensor::setMockValue(SensorType::Tps1Primary, 0);
@ -589,7 +589,7 @@ TEST(etb, setOutputInvalid) {
}
TEST(etb, setOutputValid) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<MockMotor> motor;
// Must have TPS & PPS initialized for ETB setup
@ -609,7 +609,7 @@ TEST(etb, setOutputValid) {
}
TEST(etb, setOutputValid2) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<MockMotor> motor;
// Must have TPS & PPS initialized for ETB setup
@ -629,7 +629,7 @@ TEST(etb, setOutputValid2) {
}
TEST(etb, setOutputOutOfRangeHigh) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<MockMotor> motor;
// Must have TPS & PPS initialized for ETB setup
@ -649,7 +649,7 @@ TEST(etb, setOutputOutOfRangeHigh) {
}
TEST(etb, setOutputOutOfRangeLow) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<MockMotor> motor;
// Must have TPS & PPS initialized for ETB setup
@ -669,7 +669,7 @@ TEST(etb, setOutputOutOfRangeLow) {
}
TEST(etb, setOutputPauseControl) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<MockMotor> motor;
// Must have TPS & PPS initialized for ETB setup
@ -690,7 +690,7 @@ TEST(etb, setOutputPauseControl) {
}
TEST(etb, setOutputLimpHome) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<MockMotor> motor;
// Must have TPS & PPS initialized for ETB setup
@ -742,7 +742,7 @@ TEST(etb, closedLoopPid) {
extern int timeNowUs;
TEST(etb, jamDetection) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
pid_s pid = {};
@ -793,7 +793,7 @@ TEST(etb, jamDetection) {
}
TEST(etb, openLoopThrottle) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Redundant TPS & accelerator pedal required for init
Sensor::setMockValue(SensorType::Tps1Primary, 0);
@ -815,7 +815,7 @@ TEST(etb, openLoopThrottle) {
}
TEST(etb, openLoopNonThrottle) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Redundant TPS & accelerator pedal required for init
Sensor::setMockValue(SensorType::Tps1Primary, 0);

View File

@ -24,7 +24,7 @@ static EtbController * initEtbIntegratedTest() {
}
TEST(etb, integrated) {
EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method
EngineTestHelper eth(engine_type_e::TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method
EtbController *etb = initEtbIntegratedTest();
Sensor::setMockValue(SensorType::AcceleratorPedalPrimary, 40);
@ -50,7 +50,7 @@ TEST(etb, integrated) {
extern int timeNowUs;
TEST(etb, intermittentTps) {
EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method
EngineTestHelper eth(engine_type_e::TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method
EtbController *etb = initEtbIntegratedTest();
// Tell the sensor checker that the ignition is on
@ -94,7 +94,7 @@ TEST(etb, intermittentTps) {
}
TEST(etb, intermittentPps) {
EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method
EngineTestHelper eth(engine_type_e::TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method
Sensor::setMockValue(SensorType::AcceleratorPedal, 10, true);
EtbController *etb = initEtbIntegratedTest();

View File

@ -3,7 +3,7 @@
#include "fan_control.h"
TEST(Actuators, Fan) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->fanOnTemperature = 90;
engineConfiguration->fanOffTemperature = 80;

View File

@ -12,7 +12,7 @@
extern int timeNowUs;
TEST(Actuators, FuelPump) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
FuelPumpController dut;

View File

@ -74,7 +74,7 @@ TEST(GpPwm, OutputOnOff) {
}
TEST(GpPwm, TestGetOutput) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
GppwmChannel ch;
gppwm_channel cfg;

View File

@ -3,7 +3,7 @@
#include "main_relay.h"
TEST(Actuators, MainRelay) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
MainRelayController dut;

View File

@ -5,7 +5,7 @@ extern float getTachDuty(void);
TEST(Actuators, Tachometer) {
// This engine has a tach pin set - we need that
EngineTestHelper eth(FRANKENSO_MAZDA_MIATA_2003);
EngineTestHelper eth(engine_type_e::FRANKENSO_MAZDA_MIATA_2003);
// We don't actually care about ign/inj at all, just tach
engineConfiguration->isInjectionEnabled = false;
@ -18,7 +18,7 @@ TEST(Actuators, Tachometer) {
engineConfiguration->tachPulseDurationAsDutyCycle = true;
// Set predictable trigger settings
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 8;
engineConfiguration->trigger.customSkippedToothCount = 0;
setCamOperationMode();

View File

@ -6,7 +6,7 @@ using ::testing::StrictMock;
using ::testing::Return;
TEST(Vvt, TestSetPoint) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Set up a mock target map
StrictMock<MockVp3d> targetMap;
@ -25,7 +25,7 @@ TEST(Vvt, TestSetPoint) {
}
TEST(Vvt, observePlant) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engine->triggerCentral.vvtPosition[0][0] = 23;
@ -43,7 +43,7 @@ TEST(Vvt, openLoop) {
}
TEST(Vvt, ClosedLoopNotInverted) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
VvtController dut;
dut.init(0, 0, 0, nullptr);
@ -58,7 +58,7 @@ TEST(Vvt, ClosedLoopNotInverted) {
}
TEST(Vvt, ClosedLoopInverted) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
VvtController dut;
dut.init(0, 0, 0, nullptr);

View File

@ -30,7 +30,7 @@ static void doRevolution(EngineTestHelper& eth, int periodMs) {
// https://github.com/rusefi/rusefi/issues/1592
TEST(fuelControl, transitionIssue1592) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engine->tdcMarkEnabled = false;
setupSimpleTestEngineWithMafAndTT_ONE_trigger(&eth, IM_SEQUENTIAL);
@ -40,7 +40,7 @@ TEST(fuelControl, transitionIssue1592) {
// This is easiest to trip on a wheel that requires sync
engineConfiguration->trigger.customTotalToothCount = 6;
engineConfiguration->trigger.customSkippedToothCount = 1;
eth.setTriggerType(TT_TOOTHED_WHEEL);
eth.setTriggerType(trigger_type_e::TT_TOOTHED_WHEEL);
setCamOperationMode();
engineConfiguration->isFasterEngineSpinUpEnabled = true;

View File

@ -9,7 +9,7 @@
TEST(scheduler, dwellIssue796) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
setupSimpleTestEngineWithMafAndTT_ONE_trigger(&eth, IM_SEQUENTIAL);
eth.fireTriggerEvents2(4 /* count */ , 600 /* ms */);

View File

@ -16,7 +16,7 @@ using ::testing::_;
#define EXPECT_CUT() EXPECT_FLOAT_EQ(0, engine->engineState.injectionDuration)
TEST(fuelCut, coasting) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _))
.WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f}));
@ -131,7 +131,7 @@ TEST(fuelCut, coasting) {
}
TEST(fuelCut, delay) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _))
.WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f}));

View File

@ -14,7 +14,7 @@ public:
};
TEST(FuelComputer, getCycleFuel) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
MockFuelComputer dut;
@ -30,7 +30,7 @@ TEST(FuelComputer, getCycleFuel) {
}
TEST(FuelComputer, FlexFuel) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
FuelComputer dut;

View File

@ -16,7 +16,7 @@ using ::testing::FloatNear;
TEST(misc, testFuelMap) {
printf("Setting up FORD_ASPIRE_1996\r\n");
EngineTestHelper eth(FORD_ASPIRE_1996);
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
for (int i = 0; i < VBAT_INJECTOR_CURVE_SIZE; i++) {
engineConfiguration->injector.battLagCorrBins[i] = i;
@ -129,7 +129,7 @@ static void configureFordAspireTriggerWaveform(TriggerWaveform * s) {
TEST(misc, testAngleResolver) {
printf("*************************************************** testAngleResolver\r\n");
EngineTestHelper eth(FORD_ASPIRE_1996);
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
engineConfiguration->globalTriggerAngleOffset = 175;

View File

@ -10,7 +10,7 @@ using ::testing::InSequence;
using ::testing::_;
TEST(FuelMath, getStandardAirCharge) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Miata 1839cc 4cyl
engineConfiguration->displacement = 1.839f;
@ -37,7 +37,7 @@ TEST(FuelMath, getStandardAirCharge) {
}
TEST(AirmassModes, AlphaNNormal) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// 4 cylinder 4 liter = easy math
engineConfiguration->displacement = 4.0f;
engineConfiguration->cylindersCount = 4;
@ -61,7 +61,7 @@ TEST(AirmassModes, AlphaNNormal) {
}
TEST(AirmassModes, AlphaNFailedTps) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Shouldn't get called
StrictMock<MockVp3d> veTable;
@ -78,7 +78,7 @@ TEST(AirmassModes, AlphaNFailedTps) {
}
TEST(AirmassModes, MafNormal) {
EngineTestHelper eth(FORD_ASPIRE_1996);
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
engineConfiguration->fuelAlgorithm = LM_REAL_MAF;
engineConfiguration->injector.flow = 200;
@ -119,7 +119,7 @@ TEST(AirmassModes, VeOverride) {
}
};
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
DummyAirmassModel dut(veTable);
// Use default mode - will call with 10
@ -148,7 +148,7 @@ TEST(AirmassModes, FallbackMap) {
EXPECT_CALL(mapFallback, getValue(5678, 20)).WillOnce(Return(75));
}
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
SpeedDensityAirmass dut(veTable, mapFallback);
@ -167,7 +167,7 @@ TEST(AirmassModes, FallbackMap) {
void setInjectionMode(int value);
TEST(FuelMath, testDifferentInjectionModes) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
setupSimpleTestEngineWithMafAndTT_ONE_trigger(&eth);
EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _))
@ -192,7 +192,7 @@ TEST(FuelMath, testDifferentInjectionModes) {
}
TEST(FuelMath, deadtime) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
setupSimpleTestEngineWithMafAndTT_ONE_trigger(&eth);
@ -212,7 +212,7 @@ TEST(FuelMath, deadtime) {
}
TEST(FuelMath, CylinderFuelTrim) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _))
.WillRepeatedly(Return(AirmassResult{1, 50.0f}));
@ -242,7 +242,7 @@ struct MockIdle : public MockIdleController {
};
TEST(FuelMath, IdleVeTable) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
MockAirmass dut;

View File

@ -16,7 +16,7 @@ struct MockWallController : public IWallFuelController {
};
TEST(fuel, testWallWettingEnrichmentMath) {
EngineTestHelper eth(FORD_ASPIRE_1996);
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
MockWallController wallController;
@ -62,12 +62,12 @@ TEST(fuel, testWallWettingEnrichmentMath) {
TEST(fuel, testWallWettingEnrichmentScheduling) {
EngineTestHelper eth(FORD_ASPIRE_1996);
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
engineConfiguration->isFasterEngineSpinUpEnabled = false;
setCrankOperationMode();
eth.setTriggerType(TT_ONE);
eth.setTriggerType(trigger_type_e::TT_ONE);
eth.fireTriggerEvents2(/* count */ 4, 25 /* ms */);

View File

@ -11,7 +11,7 @@
using ::testing::_;
TEST(ignition, twoCoils) {
EngineTestHelper eth(FRANKENSO_BMW_M73_F);
EngineTestHelper eth(engine_type_e::FRANKENSO_BMW_M73_F);
// let's recalculate with zero timing so that we can focus on relation advance between cylinders
setArrayValues(engine->engineState.timingAdvance, 0.0f);
@ -43,7 +43,7 @@ TEST(ignition, twoCoils) {
}
TEST(ignition, trailingSpark) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->isFasterEngineSpinUpEnabled = false;
/**
@ -127,7 +127,7 @@ TEST(ignition, trailingSpark) {
}
TEST(ignition, CylinderTimingTrim) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Base timing 15 degrees
setTable(config->ignitionTable, 15);

View File

@ -106,7 +106,7 @@ TEST(InjectorModel, nonLinearFordMode) {
}
TEST(InjectorModel, nonlinearPolynomial) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
InjectorModel dut;
engineConfiguration->applyNonlinearBelowPulse = 10;
@ -130,7 +130,7 @@ TEST(InjectorModel, nonlinearPolynomial) {
}
TEST(InjectorModel, Deadtime) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Some test data in the injector correction table
for (size_t i = 0; i < efi::size(engineConfiguration->injector.battLagCorr); i++) {
@ -172,7 +172,7 @@ TEST_P(FlowRateFixture, PressureRatio) {
StrictMock<TesterGetRailPressure> dut;
EXPECT_CALL(dut, getFuelDifferentialPressure()).WillOnce(Return(400 * pressureRatio));
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Use injector compensation
engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure;
@ -187,7 +187,7 @@ TEST_P(FlowRateFixture, PressureRatio) {
TEST(InjectorModel, NegativePressureDelta) {
StrictMock<TesterGetRailPressure> dut;
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Use injector compensation
engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure;
@ -204,7 +204,7 @@ TEST(InjectorModel, NegativePressureDelta) {
TEST(InjectorModel, VariableInjectorFlowModeNone) {
StrictMock<TesterGetRailPressure> dut;
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->injectorCompensationMode = ICM_None;
@ -215,7 +215,7 @@ TEST(InjectorModel, VariableInjectorFlowModeNone) {
TEST(InjectorModel, RailPressureFixed) {
InjectorModel dut;
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Reference pressure is 350kpa
engineConfiguration->fuelReferencePressure = 350;
@ -234,7 +234,7 @@ TEST(InjectorModel, RailPressureFixed) {
TEST(InjectorModel, RailPressureSensedAbsolute) {
InjectorModel dut;
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Reference pressure is 350kpa
engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure;
@ -254,7 +254,7 @@ TEST(InjectorModel, RailPressureSensedAbsolute) {
TEST(InjectorModel, RailPressureSensedGauge) {
InjectorModel dut;
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Reference pressure is 350kpa
engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure;
@ -275,7 +275,7 @@ TEST(InjectorModel, RailPressureSensedGauge) {
TEST(InjectorModel, RailPressureSensedDifferential) {
InjectorModel dut;
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Reference pressure is 350kpa
engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure;
@ -293,7 +293,7 @@ TEST(InjectorModel, RailPressureSensedDifferential) {
TEST(InjectorModel, FailedPressureSensor) {
InjectorModel dut;
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Reference pressure is 350kpa
engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure;
@ -311,7 +311,7 @@ TEST(InjectorModel, FailedPressureSensor) {
TEST(InjectorModel, MissingPressureSensor) {
InjectorModel dut;
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Reference pressure is 350kpa
engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure;

View File

@ -9,7 +9,7 @@
#include "advance_map.h"
TEST(Multispark, DefaultConfiguration) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
EXPECT_EQ(0, getMultiSparkCount(0 ));
EXPECT_EQ(0, getMultiSparkCount(100 ));
@ -37,7 +37,7 @@ static void multisparkCfg() {
}
TEST(Multispark, EnabledNoMaxRpm) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
multisparkCfg();
@ -62,7 +62,7 @@ TEST(Multispark, EnabledNoMaxRpm) {
}
TEST(Multispark, RpmLimit) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
multisparkCfg();

View File

@ -7,7 +7,7 @@
#include "spark_logic.h"
TEST(issues, issueOneCylinderSpecialCase968) {
EngineTestHelper eth(GY6_139QMB);
EngineTestHelper eth(engine_type_e::GY6_139QMB);
setTable(config->injectionPhase, -180.0f);
engineConfiguration->isFasterEngineSpinUpEnabled = false;
engine->tdcMarkEnabled = false;
@ -16,7 +16,7 @@ TEST(issues, issueOneCylinderSpecialCase968) {
setCrankOperationMode();
eth.setTriggerType(TT_ONE);
eth.setTriggerType(trigger_type_e::TT_ONE);
ASSERT_EQ( 0, engine->executor.size()) << "start";

View File

@ -8,7 +8,7 @@
#include "pch.h"
TEST(engine, testPlainCrankingWithoutAdvancedFeatures) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
setTable(config->injectionPhase, -180.0f);
engineConfiguration->isFasterEngineSpinUpEnabled = false;
engine->tdcMarkEnabled = false;
@ -34,7 +34,7 @@ TEST(engine, testPlainCrankingWithoutAdvancedFeatures) {
TEST(priming, startScheduling) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "RPM=0";
@ -45,7 +45,7 @@ TEST(priming, startScheduling) {
}
TEST(priming, duration) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
MockInjectorModel2 injectorModel;
engine->module<InjectorModel>().set(&injectorModel);

View File

@ -2,7 +2,7 @@
#include "value_lookup.h"
TEST(LuaBasic, configLookup) {
EngineTestHelper eth(FORD_ESCORT_GT);
EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT);
{
const char * name = "ignitionDwellForCrankingMs";
setConfigValueByName(name, 1.6);

View File

@ -23,7 +23,7 @@ TEST(LuaHooks, TestCrc8) {
}
TEST(LuaHooks, TestGetCalibration) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
const char* sourceCode = R"(
function testFunc()
@ -35,7 +35,7 @@ TEST(LuaHooks, TestGetCalibration) {
}
TEST(LuaHooks, TestSetCalibration) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
const char* sourceCode = R"(
function testFunc()
@ -92,7 +92,7 @@ TEST(LuaHooks, Table3d) {
end
)";
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
setTable(config->scriptTable2, (uint8_t)33);
EXPECT_EQ(testLuaReturnsNumber(tableTest), 33);

View File

@ -9,7 +9,7 @@
TEST(LuaVin, Test) {
EngineTestHelper eth(TEST_CRANK_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_CRANK_ENGINE);
strcpy(engineConfiguration->vinNumber, "GM123");

View File

@ -19,7 +19,7 @@ end
)";
TEST(LuaHooks, TestCurve) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
strcpy(engineConfiguration->scriptCurveName[3], "hello");
setLinearCurve(config->scriptCurve4, 500, 600, 1);

View File

@ -50,7 +50,7 @@ public:
*/
TEST_F(FrequencySensorTest, testValidWithPwm) {
ASSERT_TRUE(dut.Register());
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Should be invalid - not set yet
{

View File

@ -24,7 +24,7 @@ static void postToFuncSensor(Sensor* s, float value) {
}
TEST(SensorInit, Tps) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->tpsMin = 200; // 1 volt
engineConfiguration->tpsMax = 800; // 4 volts
@ -50,7 +50,7 @@ TEST(SensorInit, Tps) {
}
TEST(SensorInit, TpsValuesTooClose) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Should fail, 0.49 volts apart
engineConfiguration->tpsMin = 200; // 1.00 volt
@ -97,7 +97,7 @@ TEST(SensorInit, TpsValuesTooClose) {
}
TEST(SensorInit, Pedal) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_0;
engineConfiguration->throttlePedalUpVoltage = 1;
@ -124,7 +124,7 @@ TEST(SensorInit, Pedal) {
}
TEST(SensorInit, DriverIntentNoPedal) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// We have no pedal - so we should get the TPS
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_NONE;
@ -145,7 +145,7 @@ TEST(SensorInit, DriverIntentNoPedal) {
TEST(SensorInit, DriverIntentWithPedal) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// We have a pedal, so we should get it
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_0;
@ -164,7 +164,7 @@ TEST(SensorInit, DriverIntentWithPedal) {
}
TEST(SensorInit, OilPressure) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->oilPressure.hwChannel = EFI_ADC_0;
engineConfiguration->oilPressure.v1 = 1;
@ -189,7 +189,7 @@ TEST(SensorInit, OilPressure) {
}
TEST(SensorInit, Clt) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// 2003 neon sensor
engineConfiguration->clt.config = {0, 30, 100, 32500, 7550, 700, 2700};
@ -212,7 +212,7 @@ TEST(SensorInit, Clt) {
}
TEST(SensorInit, Lambda) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// No channel -> no sensor
initLambda();
@ -233,7 +233,7 @@ TEST(SensorInit, Lambda) {
}
TEST(SensorInit, Map) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
initMap();

View File

@ -1,7 +1,7 @@
#include "pch.h"
#include "turbocharger_speed_converter.h"
static constexpr engine_type_e ENGINE_TEST_HELPER = TEST_ENGINE;
static constexpr engine_type_e ENGINE_TEST_HELPER = engine_type_e::TEST_ENGINE;
class TurbochargerSpeedConverterTest : public ::testing::Test {

View File

@ -3,7 +3,7 @@
float GetVssFor(float revPerKm, float axle, float teeth, float hz) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
VehicleSpeedConverter dut;

View File

@ -15,7 +15,7 @@
TEST(fuel, testTpsAccelEnrichmentMath) {
printf("====================================================================================== testAccelEnrichment\r\n");
EngineTestHelper eth(FORD_ASPIRE_1996);
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
engine->rpmCalculator.setRpmValue(600);
engine->periodicFastCallback();
@ -40,14 +40,14 @@ TEST(fuel, testTpsAccelEnrichmentMath) {
}
TEST(fuel, testTpsAccelEnrichmentScheduling) {
EngineTestHelper eth(FORD_ASPIRE_1996);
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
setCrankOperationMode();
engineConfiguration->tpsAccelEnrichmentThreshold = 5;
engineConfiguration->tpsAccelLookback = 2;
eth.setTriggerType(TT_ONE);
eth.setTriggerType(trigger_type_e::TT_ONE);
Sensor::setMockValue(SensorType::Tps1, 0);
@ -97,7 +97,7 @@ static void doFractionalTpsIteration(int period, int divisor, int numCycles, std
TEST(fuel, testAccelEnrichmentFractionalTps) {
printf("====================================================================================== testAccelEnrichmentFractionalTps\r\n");
EngineTestHelper eth(FORD_ASPIRE_1996);
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
// setup
engineConfiguration->tpsAccelEnrichmentThreshold = 5;

View File

@ -55,7 +55,7 @@ public:
TestCanStreamerState() : CanStreamerState(&streamer) {}
void test(const std::vector<std::string> & dataList, const std::vector<std::string> & frames, int fifoLeftoverSize, const std::vector<size_t> & receiveChunks) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
size_t totalSize = 0;
std::string totalData;

View File

@ -99,7 +99,7 @@ TEST(CanWideband, DecodeValidAemFormat) {
TEST(CanWideband, DecodeRusefiStandard)
{
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
AemXSeriesWideband dut(0, SensorType::Lambda1);
dut.Register();
@ -139,7 +139,7 @@ TEST(CanWideband, DecodeRusefiStandard)
TEST(CanWideband, DecodeRusefiStandardWrongVersion)
{
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
AemXSeriesWideband dut(0, SensorType::Lambda1);
dut.Register();

View File

@ -13,7 +13,7 @@ TEST(misc, changeEngineType) {
/**
* this configuration has triggerInputDebugPins defined
*/
EngineTestHelper eth (FORD_ASPIRE_1996);
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
brain_pin_e brainPin = engineConfiguration->triggerInputDebugPins[0];
ASSERT_TRUE(brainPin != Gpio::Unassigned);
@ -25,7 +25,7 @@ TEST(misc, changeEngineType) {
// above we have asserted that triggerInputDebugPins is in fact used
// now let's change into engine type without triggerInputDebugPins and assert shut down
setEngineType((int)CITROEN_TU3JP);
setEngineType(engine_type_e::CITROEN_TU3JP);
ASSERT_TRUE(activeConfiguration.triggerInputDebugPins[0] == Gpio::Unassigned);
ASSERT_TRUE(engineConfiguration->triggerInputDebugPins[0] == Gpio::Unassigned);

View File

@ -17,7 +17,7 @@ void printResults(DynoView *dut) {
TEST(DynoView, VSS_T1) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
DynoView dut;
@ -36,7 +36,7 @@ TEST(DynoView, VSS_T1) {
}
TEST(DynoView, algo) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
DynoView dut;
@ -60,7 +60,7 @@ TEST(DynoView, algo) {
}
TEST(DynoView, VSS_fast) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
DynoView dut;
@ -83,7 +83,7 @@ TEST(DynoView, VSS_fast) {
TEST(DynoView, VSS_Torque) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
DynoView dut;

View File

@ -13,7 +13,7 @@
TEST(misc, testIgnitionPlanning) {
printf("*************************************************** testIgnitionPlanning\r\n");
EngineTestHelper eth(FORD_ESCORT_GT);
EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT);
engine->periodicFastCallback();
assertEqualsM("testIgnitionPlanning_AFR", 13.5, engine->fuelComputer.targetAFR);
@ -25,7 +25,7 @@ TEST(misc, testEngineMath) {
printf("*************************************************** testEngineMath\r\n");
// todo: let's see if we can make 'engine' unneeded in this test?
EngineTestHelper eth(FORD_ESCORT_GT);
EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT);
setCamOperationMode();
engineConfiguration->fuelAlgorithm = LM_SPEED_DENSITY;

View File

@ -1,7 +1,7 @@
#include "pch.h"
float GetGearRatioFor(float revPerKm, float axle, float kph, float rpm) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->driveWheelRevPerKm = revPerKm;
engineConfiguration->finalGearRatio = axle;
@ -29,7 +29,7 @@ TEST(GearDetector, ComputeGearRatio) {
TEST(GearDetector, GetRpmInGear) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->driveWheelRevPerKm = 507;
engineConfiguration->finalGearRatio = 4.10f;
@ -68,7 +68,7 @@ TEST(GearDetector, GetRpmInGear) {
}
TEST(GearDetector, DetermineGearSingleSpeed) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
auto& dut = engine->module<GearDetector>().unmock();
engineConfiguration->totalGearsCount = 1;
@ -92,7 +92,7 @@ TEST(GearDetector, DetermineGearSingleSpeed) {
}
TEST(GearDetector, DetermineGear5Speed) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
auto& dut = engine->module<GearDetector>().unmock();
engineConfiguration->totalGearsCount = 5;
@ -136,7 +136,7 @@ TEST(GearDetector, DetermineGear5Speed) {
}
TEST(GearDetector, MiataNb6Speed) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
auto& dut = engine->module<GearDetector>().unmock();
engineConfiguration->totalGearsCount = 6;
@ -164,7 +164,7 @@ TEST(GearDetector, MiataNb6Speed) {
}
TEST(GearDetector, DetermineGear8Speed) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
auto& dut = engine->module<GearDetector>().unmock();
// ZF 8HP 70
@ -203,7 +203,7 @@ TEST(GearDetector, DetermineGear8Speed) {
}
TEST(GearDetector, ParameterValidation) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
auto& dut = engine->module<GearDetector>().unmock();
// Defaults should work

View File

@ -1,7 +1,7 @@
#include "pch.h"
TEST(gpio, testPinInitNonInverted) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
OutputPin dut;
@ -16,7 +16,7 @@ TEST(gpio, testPinInitNonInverted) {
}
TEST(gpio, testPinInitInverted) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
OutputPin dut;

View File

@ -1,7 +1,7 @@
#include "pch.h"
TEST(hardware, reinit) {
EngineTestHelper eth(FRANKENSO_MIATA_NA6_MAP);
EngineTestHelper eth(engine_type_e::FRANKENSO_MIATA_NA6_MAP);
ButtonDebounce::stopConfigurationList();
ButtonDebounce::startConfigurationList();
@ -10,6 +10,6 @@ TEST(hardware, reinit) {
ButtonDebounce::startConfigurationList();
resetConfigurationExt(nullptr, DODGE_NEON_1995);
resetConfigurationExt(nullptr, FRANKENSO_MIATA_NA6_MAP);
resetConfigurationExt(nullptr, engine_type_e::DODGE_NEON_1995);
resetConfigurationExt(nullptr, engine_type_e::FRANKENSO_MIATA_NA6_MAP);
}

View File

@ -7,7 +7,7 @@ using ::testing::_;
using ::testing::StrictMock;
TEST(HPFP, Lobe) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->hpfpCam = HPFP_CAM_NONE;
engineConfiguration->hpfpPeakPos = 123;
@ -51,7 +51,7 @@ TEST(HPFP, Lobe) {
}
TEST(HPFP, InjectionReplacementFuel) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->cylindersCount = 4;
engineConfiguration->hpfpCamLobes = 4;
@ -104,7 +104,7 @@ TEST(HPFP, InjectionReplacementFuel) {
}
TEST(HPFP, PI) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->cylindersCount = 4;
engineConfiguration->hpfpCamLobes = 4;
@ -161,7 +161,7 @@ TEST(HPFP, PI) {
}
TEST(HPFP, Angle) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->cylindersCount = 4;
engineConfiguration->hpfpCamLobes = 4;
@ -207,7 +207,7 @@ TEST(HPFP, Angle) {
}
TEST(HPFP, Schedule) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->cylindersCount = 4;
engineConfiguration->hpfpCamLobes = 4;

View File

@ -8,7 +8,7 @@
#include "pch.h"
TEST(HPFP, IntegratedSchedule) {
EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
engineConfiguration->hpfpValvePin = Gpio::A2; // arbitrary
});
@ -19,7 +19,7 @@ TEST(HPFP, IntegratedSchedule) {
engineConfiguration->trigger.customTotalToothCount = 16;
engineConfiguration->trigger.customSkippedToothCount = 0;
eth.setTriggerType(TT_TOOTHED_WHEEL);
eth.setTriggerType(trigger_type_e::TT_TOOTHED_WHEEL);
setCamOperationMode();
engineConfiguration->isFasterEngineSpinUpEnabled = true;

View File

@ -18,7 +18,7 @@ using ::testing::_;
using ICP = IIdleController::Phase;
TEST(idle_v2, timingPid) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
engineConfiguration->useIdleTimingPidControl = true;
@ -50,7 +50,7 @@ TEST(idle_v2, timingPid) {
}
TEST(idle_v2, testTargetRpm) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
for (size_t i = 0; i < efi::size(config->cltIdleRpmBins); i++) {
@ -63,7 +63,7 @@ TEST(idle_v2, testTargetRpm) {
}
TEST(idle_v2, testDeterminePhase) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
// TPS threshold 5% for easy test
@ -108,7 +108,7 @@ TEST(idle_v2, testDeterminePhase) {
}
TEST(idle_v2, crankingOpenLoop) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
engineConfiguration->crankingIACposition = 50;
@ -133,7 +133,7 @@ TEST(idle_v2, crankingOpenLoop) {
}
TEST(idle_v2, runningOpenLoopBasic) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
engineConfiguration->manIdlePosition = 50;
@ -148,7 +148,7 @@ TEST(idle_v2, runningOpenLoopBasic) {
}
TEST(idle_v2, runningFanAcBump) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
engineConfiguration->manIdlePosition = 50;
@ -186,7 +186,7 @@ TEST(idle_v2, runningFanAcBump) {
}
TEST(idle_v2, runningOpenLoopTpsTaper) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
// Zero out base tempco table
@ -208,7 +208,7 @@ TEST(idle_v2, runningOpenLoopTpsTaper) {
}
TEST(idle_v2, runningOpenLoopRpmTaper) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
// Zero out base tempco table
@ -236,7 +236,7 @@ struct MockOpenLoopIdler : public IdleController {
};
TEST(idle_v2, testOpenLoopCranking) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<MockOpenLoopIdler> dut;
engineConfiguration->overrideCrankingIacSetting = true;
@ -248,7 +248,7 @@ TEST(idle_v2, testOpenLoopCranking) {
}
TEST(idle_v2, openLoopRunningTaper) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<MockOpenLoopIdler> dut;
EXPECT_CALL(dut, getRunningOpenLoop(0, 30, SensorResult(0))).WillRepeatedly(Return(25));
@ -272,7 +272,7 @@ TEST(idle_v2, openLoopRunningTaper) {
}
TEST(idle_v2, getCrankingTaperFraction) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<MockOpenLoopIdler> dut;
engineConfiguration->afterCrankingIACtaperDuration = 500;
@ -300,7 +300,7 @@ TEST(idle_v2, getCrankingTaperFraction) {
}
TEST(idle_v2, openLoopCoastingTable) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
// enable & configure feature
@ -317,7 +317,7 @@ TEST(idle_v2, openLoopCoastingTable) {
extern int timeNowUs;
TEST(idle_v2, closedLoopBasic) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
dut.init();
@ -344,7 +344,7 @@ TEST(idle_v2, closedLoopBasic) {
}
TEST(idle_v2, closedLoopDeadzone) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
IdleController dut;
dut.init();
@ -380,7 +380,7 @@ struct IntegrationIdleMock : public IdleController {
};
TEST(idle_v2, IntegrationManual) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<IntegrationIdleMock> dut;
SensorResult expectedTps = 1;
@ -411,7 +411,7 @@ TEST(idle_v2, IntegrationManual) {
}
TEST(idle_v2, IntegrationAutomatic) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<IntegrationIdleMock> dut;
engineConfiguration->idleMode = IM_AUTO;
@ -447,7 +447,7 @@ TEST(idle_v2, IntegrationAutomatic) {
}
TEST(idle_v2, IntegrationClamping) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
StrictMock<IntegrationIdleMock> dut;
engineConfiguration->idleMode = IM_AUTO;

View File

@ -15,7 +15,7 @@ struct MockKnockController : public KnockControllerBase {
};
TEST(Knock, Retards) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Aggression of 10%
engineConfiguration->knockRetardAggression = 10;
@ -48,7 +48,7 @@ TEST(Knock, Retards) {
}
TEST(Knock, Reapply) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
MockKnockController dut;
dut.onFastCallback();

View File

@ -3,7 +3,7 @@
#include "launch_control.h"
TEST(LaunchControl, TpsCondition) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
LaunchControlBase dut;
@ -24,7 +24,7 @@ TEST(LaunchControl, TpsCondition) {
TEST(LaunchControl, VSSCondition) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
LaunchControlBase dut;
@ -41,7 +41,7 @@ TEST(LaunchControl, VSSCondition) {
}
TEST(LaunchControl, RPMCondition) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
LaunchControlBase dut;
@ -53,7 +53,7 @@ TEST(LaunchControl, RPMCondition) {
}
TEST(LaunchControl, SwitchInputCondition) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
LaunchControlBase dut;
@ -95,7 +95,7 @@ TEST(LaunchControl, SwitchInputCondition) {
}
TEST(LaunchControl, CombinedCondition) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
LaunchControlBase dut;
@ -138,7 +138,7 @@ static void setDefaultLaunchParameters() {
}
TEST(LaunchControl, CompleteRun) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
initLaunchControl();

View File

@ -21,7 +21,7 @@ TEST(limp, testFatalError) {
}
TEST(limp, revLimit) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->rpmHardLimit = 2500;
@ -44,7 +44,7 @@ TEST(limp, revLimit) {
}
TEST(limp, revLimitCltBased) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->rpmHardLimit = 2500;
@ -94,7 +94,7 @@ TEST(limp, revLimitCltBased) {
}
TEST(limp, boostCut) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
// Cut above 100kPa
engineConfiguration->boostCutPressure = 100;
@ -131,7 +131,7 @@ TEST(limp, boostCut) {
extern int timeNowUs;
TEST(limp, oilPressureFailureCase) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->minOilPressureAfterStart = 200;
LimpManager dut;
@ -164,7 +164,7 @@ TEST(limp, oilPressureFailureCase) {
}
TEST(limp, oilPressureSuccessCase) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->minOilPressureAfterStart = 200;
LimpManager dut;

View File

@ -9,7 +9,7 @@
TEST(start, startStop) {
std::unordered_map<SensorType, float> sensorVals = {{ SensorType::AcceleratorPedal, 0 }};
EngineTestHelper eth(PROTEUS_BMW_M73, sensorVals);
EngineTestHelper eth(engine_type_e::PROTEUS_BMW_M73, sensorVals);
eth.moveTimeForwardAndInvokeEventsSec(1); // '0' time has special meaning for implementation so let's move forward
// this is a pull-up, so 'true' on start-up

View File

@ -77,7 +77,7 @@ TEST(ClosedLoopFuel, CellSelection) {
}
TEST(ClosedLoopFuel, afrLimits) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->stft.minAfr = 10; // 10.0 AFR
engineConfiguration->stft.maxAfr = 18; // 18.0 AFR

View File

@ -68,7 +68,7 @@ TEST(binary, testWriteCrc) {
}
TEST(TunerstudioCommands, writeChunkEngineConfig) {
EngineTestHelper eth(TEST_ENGINE);
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
::testing::NiceMock<MockTsChannel> channel;
uint8_t* configBytes = reinterpret_cast<uint8_t*>(config);

Some files were not shown because too many files have changed in this diff Show More