diff --git a/firmware/config/boards/kinetis/efifeatures.h b/firmware/config/boards/kinetis/efifeatures.h index ab140bd599..448c642511 100644 --- a/firmware/config/boards/kinetis/efifeatures.h +++ b/firmware/config/boards/kinetis/efifeatures.h @@ -208,14 +208,9 @@ #endif /** - * While we embed multiple PnP configurations into the same firmware binary, these marcoses give us control - * over which configurations go into the binary + * Should PnP engine configurations be included in the binary? */ -#define EFI_SUPPORT_DODGE_NEON FALSE -#define EFI_SUPPORT_FORD_ASPIRE FALSE -#define EFI_SUPPORT_FORD_FIESTA FALSE -#define EFI_SUPPORT_NISSAN_PRIMERA FALSE -#define EFI_SUPPORT_1995_FORD_INLINE_6 FALSE +#define EFI_INCLUDE_ENGINE_PRESETS FALSE #ifndef EFI_ENGINE_SNIFFER #define EFI_ENGINE_SNIFFER FALSE diff --git a/firmware/config/boards/skeleton/efifeatures.h b/firmware/config/boards/skeleton/efifeatures.h index 38d6d4886a..e17d06b02d 100644 --- a/firmware/config/boards/skeleton/efifeatures.h +++ b/firmware/config/boards/skeleton/efifeatures.h @@ -221,14 +221,10 @@ #define EFI_USB_SERIAL TRUE -// For now we can still embed all car configurations into the firmware binary. -// These give us control over which configurations go in. - -#define EFI_SUPPORT_DODGE_NEON TRUE -#define EFI_SUPPORT_FORD_ASPIRE TRUE -#define EFI_SUPPORT_FORD_FIESTA TRUE -#define EFI_SUPPORT_NISSAN_PRIMERA TRUE -#define EFI_SUPPORT_1995_FORD_INLINE_6 TRUE +/** + * Should PnP engine configurations be included in the binary? + */ +#define EFI_INCLUDE_ENGINE_PRESETS TRUE #ifndef EFI_ENGINE_SNIFFER #define EFI_ENGINE_SNIFFER TRUE diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 05395a80ed..c2b441c480 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -14,8 +14,6 @@ #include "global.h" -#if EFI_SUPPORT_DODGE_NEON - #include "dodge_neon.h" #include "engine_configuration.h" #include "thermistors.h" @@ -502,6 +500,3 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // end of setDodgeNeonNGCEngineConfiguration } - -#endif /* EFI_SUPPORT_DODGE_NEON */ - diff --git a/firmware/config/engines/dodge_neon.h b/firmware/config/engines/dodge_neon.h index f942b2fe4a..dfb360cc8a 100644 --- a/firmware/config/engines/dodge_neon.h +++ b/firmware/config/engines/dodge_neon.h @@ -9,8 +9,6 @@ #ifndef DODGE_NEON_H_ #define DODGE_NEON_H_ -#if EFI_SUPPORT_DODGE_NEON - #include "engine_configuration.h" void setDodgeNeon1995EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); @@ -22,6 +20,4 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); */ void setDodgeNeonNGCEngineConfigurationCrankBased(DECLARE_CONFIG_PARAMETER_SIGNATURE); -#endif /* EFI_SUPPORT_DODGE_NEON */ - #endif /* DODGE_NEON_H_ */ diff --git a/firmware/config/engines/ford_1995_inline_6.cpp b/firmware/config/engines/ford_1995_inline_6.cpp index cd486aee4d..9ccdc14d08 100644 --- a/firmware/config/engines/ford_1995_inline_6.cpp +++ b/firmware/config/engines/ford_1995_inline_6.cpp @@ -16,8 +16,6 @@ #include "engine_math.h" #include "allsensors.h" -#if EFI_SUPPORT_1995_FORD_INLINE_6 - EXTERN_CONFIG; /** @@ -101,5 +99,3 @@ void setFordInline6(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->logicAnalyzerPins[0] = GPIOC_6; engineConfiguration->logicAnalyzerPins[1] = GPIOE_5; } - -#endif /* EFI_SUPPORT_1995_FORD_INLINE_6 */ diff --git a/firmware/config/engines/ford_aspire.cpp b/firmware/config/engines/ford_aspire.cpp index aa10c3b6a8..656e1035b0 100644 --- a/firmware/config/engines/ford_aspire.cpp +++ b/firmware/config/engines/ford_aspire.cpp @@ -18,8 +18,6 @@ #include "advance_map.h" #include "engine_configuration.h" -#if EFI_SUPPORT_FORD_ASPIRE - #if DEFAULT_FUEL_LOAD_COUNT == FUEL_LOAD_COUNT /** @@ -161,5 +159,3 @@ void setFordAspireEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->engineSnifferRpmThreshold = 13000; engineConfiguration->sensorSnifferRpmThreshold = 13000; } - -#endif /* EFI_SUPPORT_FORD_ASPIRE */ diff --git a/firmware/config/engines/ford_fiesta.cpp b/firmware/config/engines/ford_fiesta.cpp index 8c6c1d8695..1dba680d14 100644 --- a/firmware/config/engines/ford_fiesta.cpp +++ b/firmware/config/engines/ford_fiesta.cpp @@ -11,8 +11,6 @@ #include "global.h" -#if EFI_SUPPORT_FORD_FIESTA - #include "ford_fiesta.h" #include "engine_math.h" @@ -30,5 +28,3 @@ void setFordFiestaDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) engineConfiguration->mafAdcChannel = EFI_ADC_14; // engineConfiguration->mafAdcChannel = EFI_ADC_NONE; this would kill functional tests } - -#endif /* EFI_SUPPORT_FORD_FIESTA */ diff --git a/firmware/config/engines/ford_fiesta.h b/firmware/config/engines/ford_fiesta.h index a54242aa27..4d0eaacc7a 100644 --- a/firmware/config/engines/ford_fiesta.h +++ b/firmware/config/engines/ford_fiesta.h @@ -5,13 +5,8 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef FORD_FIESTA_H_ -#define FORD_FIESTA_H_ -#if EFI_SUPPORT_FORD_FIESTA +#pragma once #include "engine_configuration.h" void setFordFiestaDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE); - -#endif /* EFI_SUPPORT_FORD_FIESTA */ -#endif /* FORD_FIESTA_H_ */ diff --git a/firmware/config/engines/nissan_primera.cpp b/firmware/config/engines/nissan_primera.cpp index 6113c24213..0df1bfc048 100644 --- a/firmware/config/engines/nissan_primera.cpp +++ b/firmware/config/engines/nissan_primera.cpp @@ -10,7 +10,6 @@ #include "global.h" -#if EFI_SUPPORT_NISSAN_PRIMERA #include "nissan_primera.h" EXTERN_CONFIG; @@ -32,5 +31,3 @@ void setNissanPrimeraEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { void setNissanPrimeraEngineConfiguration_360(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->trigger.type = TT_NISSAN_SR20VE_360; } - -#endif /* EFI_SUPPORT_NISSAN_PRIMERA */ diff --git a/firmware/config/engines/nissan_primera.h b/firmware/config/engines/nissan_primera.h index 636ce285e1..93ea1d1546 100644 --- a/firmware/config/engines/nissan_primera.h +++ b/firmware/config/engines/nissan_primera.h @@ -7,11 +7,7 @@ #pragma once -#if EFI_SUPPORT_NISSAN_PRIMERA - #include "engine_configuration.h" void setNissanPrimeraEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setNissanPrimeraEngineConfiguration_360(DECLARE_CONFIG_PARAMETER_SIGNATURE); - -#endif /* EFI_SUPPORT_NISSAN_PRIMERA */ diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index dbab14d5cb..a2a529d4c2 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -244,14 +244,9 @@ #endif /** - * While we embed multiple PnP configurations into the same firmware binary, these marcoses give us control - * over which configurations go into the binary + * Should PnP engine configurations be included in the binary? */ -#define EFI_SUPPORT_DODGE_NEON TRUE -#define EFI_SUPPORT_FORD_ASPIRE TRUE -#define EFI_SUPPORT_FORD_FIESTA TRUE -#define EFI_SUPPORT_NISSAN_PRIMERA TRUE -#define EFI_SUPPORT_1995_FORD_INLINE_6 TRUE +#define EFI_INCLUDE_ENGINE_PRESETS TRUE #ifndef EFI_ENGINE_SNIFFER #define EFI_ENGINE_SNIFFER TRUE diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index d2c9b6bd9a..e0318e0ce3 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -708,7 +708,7 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setLinearCurve(engineConfiguration->fsioCurve3Bins, 0, 100, 1); setLinearCurve(engineConfiguration->fsioCurve4Bins, 0, 100, 1); - +#if EFI_ENGINE_CONTROL setDefaultWarmupIdleCorrection(PASS_CONFIG_PARAMETER_SIGNATURE); setDefaultWarmupFuelEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE); @@ -999,7 +999,7 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->tpsAccelLength = 12; engineConfiguration->tpsAccelEnrichmentThreshold = 40; // TPS % change, per engine cycle - +#endif // EFI_ENGINE_CONTROL #if EFI_FSIO /** * to test: @@ -1109,6 +1109,32 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb * And override them with engine-specific defaults */ switch (engineType) { + case MICRO_RUS_EFI: +// todo: is it time to replace MICRO_RUS_EFI, PROTEUS, PROMETHEUS_DEFAULTS with MINIMAL_PINS? maybe rename MINIMAL_PINS to DEFAULT? + case PROTEUS: + case PROMETHEUS_DEFAULTS: + case MINIMAL_PINS: + // all basic settings are already set in prepareVoidConfiguration(), no need to set anything here + // nothing to do - we do it all in setBoardConfigurationOverrides + break; + case MRE_BOARD_TEST: + mreBoardTest(PASS_CONFIG_PARAMETER_SIGNATURE); + break; + case TEST_ENGINE: + setTestEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + break; +#if EFI_UNIT_TEST + case TEST_ISSUE_366_BOTH: + setTestEngineIssue366both(PASS_CONFIG_PARAMETER_SIGNATURE); + break; + case TEST_ISSUE_366_RISE: + setTestEngineIssue366rise(PASS_CONFIG_PARAMETER_SIGNATURE); + break; + case ISSUE_898: + setIssue898(PASS_CONFIG_PARAMETER_SIGNATURE); + break; +#endif // EFI_UNIT_TEST +#if EFI_INCLUDE_ENGINE_PRESETS case DEFAULT_FRANKENSO: setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); break; @@ -1127,29 +1153,12 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb case MRE_MIATA_NA6: setMiataNA6_VAF_MRE(PASS_CONFIG_PARAMETER_SIGNATURE); break; -#if EFI_UNIT_TEST - case ISSUE_898: - setIssue898(PASS_CONFIG_PARAMETER_SIGNATURE); - break; -#endif case MRE_MIATA_NB2_MTB: setMiataNB2_MRE_MTB(PASS_CONFIG_PARAMETER_SIGNATURE); break; case MRE_MIATA_NB2: setMiataNB2_MRE_ETB(PASS_CONFIG_PARAMETER_SIGNATURE); break; - case MICRO_RUS_EFI: -// todo: is it time to replace MICRO_RUS_EFI, PROTEUS, PROMETHEUS_DEFAULTS with MINIMAL_PINS? maybe rename MINIMAL_PINS to DEFAULT? - case PROTEUS: - case PROMETHEUS_DEFAULTS: - case MINIMAL_PINS: - // all basic settings are already set in prepareVoidConfiguration(), no need to set anything here - // nothing to do - we do it all in setBoardConfigurationOverrides - break; - case MRE_BOARD_TEST: - mreBoardTest(PASS_CONFIG_PARAMETER_SIGNATURE); - break; -#if EFI_SUPPORT_DODGE_NEON case DODGE_NEON_1995: setDodgeNeon1995EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); break; @@ -1160,23 +1169,15 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb case LADA_KALINA: setLadaKalina(PASS_CONFIG_PARAMETER_SIGNATURE); break; - -#endif /* EFI_SUPPORT_DODGE_NEON */ -#if EFI_SUPPORT_FORD_ASPIRE case FORD_ASPIRE_1996: setFordAspireEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); break; -#endif /* EFI_SUPPORT_FORD_ASPIRE */ -#if EFI_SUPPORT_FORD_FIESTA case FORD_FIESTA: setFordFiestaDefaultEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); break; -#endif /* EFI_SUPPORT_FORD_FIESTA */ -#if EFI_SUPPORT_NISSAN_PRIMERA case NISSAN_PRIMERA: setNissanPrimeraEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); break; -#endif case HONDA_ACCORD_CD: setHondaAccordConfigurationThreeWires(PASS_CONFIG_PARAMETER_SIGNATURE); break; @@ -1216,11 +1217,9 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb case MITSU_4G93: setMitsubishiConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); break; -#if EFI_SUPPORT_1995_FORD_INLINE_6 case FORD_INLINE_6_1995: setFordInline6(PASS_CONFIG_PARAMETER_SIGNATURE); break; -#endif /* EFI_SUPPORT_1995_FORD_INLINE_6 */ case GY6_139QMB: setGy6139qmbDefaultEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); break; @@ -1269,21 +1268,6 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb case VW_ABA: setVwAba(PASS_CONFIG_PARAMETER_SIGNATURE); break; -#if EFI_UNIT_TEST - case TEST_ISSUE_366_BOTH: - setTestEngineIssue366both(PASS_CONFIG_PARAMETER_SIGNATURE); - break; - case TEST_ISSUE_366_RISE: - setTestEngineIssue366rise(PASS_CONFIG_PARAMETER_SIGNATURE); - break; -#else - case TEST_ISSUE_366_BOTH: - case TEST_ISSUE_366_RISE: -#endif - - case TEST_ENGINE: - setTestEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); - break; case MAZDA_MIATA_2003: setMazdaMiata2003EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); break; @@ -1317,7 +1301,7 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb case TOYOTA_JZS147: setToyota_jzs147EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); break; - +#endif // EFI_INCLUDE_ENGINE_PRESETS default: warning(CUSTOM_UNEXPECTED_ENGINE_TYPE, "Unexpected engine type: %d", engineType); } diff --git a/simulator/simulator/efifeatures.h b/simulator/simulator/efifeatures.h index 1f7ec3f885..da667200d6 100644 --- a/simulator/simulator/efifeatures.h +++ b/simulator/simulator/efifeatures.h @@ -62,11 +62,10 @@ #define EFI_MAP_AVERAGING TRUE #define EFI_ALTERNATOR_CONTROL TRUE -#define EFI_SUPPORT_DODGE_NEON TRUE -#define EFI_SUPPORT_FORD_ASPIRE TRUE -#define EFI_SUPPORT_FORD_FIESTA TRUE -#define EFI_SUPPORT_NISSAN_PRIMERA TRUE -#define EFI_SUPPORT_1995_FORD_INLINE_6 TRUE +/** + * Should PnP engine configurations be included in the binary? + */ +#define EFI_INCLUDE_ENGINE_PRESETS TRUE #define EFI_ENGINE_AUDI_AAN FALSE #define EFI_ENGINE_SNOW_BLOWER FALSE diff --git a/unit_tests/efifeatures.h b/unit_tests/efifeatures.h index f9795529ad..47f7cd739b 100644 --- a/unit_tests/efifeatures.h +++ b/unit_tests/efifeatures.h @@ -47,11 +47,10 @@ #define EFI_CLI_SUPPORT FALSE -#define EFI_SUPPORT_FORD_ASPIRE TRUE -#define EFI_SUPPORT_DODGE_NEON TRUE -#define EFI_SUPPORT_1995_FORD_INLINE_6 TRUE -#define EFI_SUPPORT_FORD_FIESTA TRUE -#define EFI_SUPPORT_NISSAN_PRIMERA TRUE +/** + * Should PnP engine configurations be included in the binary? + */ +#define EFI_INCLUDE_ENGINE_PRESETS TRUE #define EFI_SIGNAL_EXECUTOR_ONE_TIMER FALSE #define EFI_SIGNAL_EXECUTOR_SLEEP FALSE