diff --git a/firmware/config/engines/honda_600.cpp b/firmware/config/engines/honda_600.cpp index 9de4864f1d..9a5f00f5b3 100644 --- a/firmware/config/engines/honda_600.cpp +++ b/firmware/config/engines/honda_600.cpp @@ -75,9 +75,8 @@ void setHonda600(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setFrankenso_01_LCD(engineConfiguration); commonFrankensoAnalogInputs(engineConfiguration); setFrankenso0_1_joystick(engineConfiguration); -#if IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT - setMap(config->injectionPhase, 320); -#endif + setTable(config->injectionPhase, 320.0f); + /** * Frankenso analog #1 PC2 ADC12 CLT * Frankenso analog #2 PC1 ADC11 IAT diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 2bc1d2a949..462e7e6382 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -249,22 +249,9 @@ void setLambdaMap(lambda_table_t table, float value) { } } -// todo: make this a template -void setMap(fuel_table_t table, float value) { - for (int l = 0; l < FUEL_LOAD_COUNT; l++) { - for (int rpmIndex = 0; rpmIndex < FUEL_RPM_COUNT; rpmIndex++) { - table[l][rpmIndex] = value; - } - } -} - void setWholeIgnitionIatCorr(float value DECLARE_CONFIG_PARAMETER_SUFFIX) { -#if (IGN_LOAD_COUNT == FUEL_LOAD_COUNT) && (IGN_RPM_COUNT == FUEL_RPM_COUNT) // todo: make setMap a template - setMap(config->ignitionIatCorrTable, value); -#else - UNUSED(value); -#endif + setTable(config->ignitionIatCorrTable, value); } void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_CONFIG_PARAMETER_SUFFIX) { @@ -845,10 +832,8 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setDefaultVETable(PASS_ENGINE_PARAMETER_SIGNATURE); -#if (IGN_LOAD_COUNT == FUEL_LOAD_COUNT) && (IGN_RPM_COUNT == FUEL_RPM_COUNT) - // todo: make setMap a template - setMap(config->injectionPhase, -180); -#endif + setTable(config->injectionPhase, -180.0f); + setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT); setFuelTablesLoadBin(10, 160 PASS_CONFIG_PARAMETER_SUFFIX); setDefaultIatTimingCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index d4ad774c51..267f6734b0 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -27,10 +27,6 @@ void setOperationMode(engine_configuration_s *engineConfiguration, operation_mod void prepareVoidConfiguration(engine_configuration_s *activeConfiguration); void setTargetRpmCurve(int rpm DECLARE_CONFIG_PARAMETER_SUFFIX); void setLambdaMap(lambda_table_t table, float value); -/** - * See also setLinearCurve() - */ -void setMap(fuel_table_t table, float value); void setWholeIgnitionIatCorr(float value DECLARE_CONFIG_PARAMETER_SUFFIX); void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_CONFIG_PARAMETER_SUFFIX); void setWholeIatCorrTimingTable(float value DECLARE_CONFIG_PARAMETER_SUFFIX); diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 4847b0269a..4bfd1c25f8 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -496,9 +496,7 @@ static void setWholeTimingMap(float value) { static void setWholePhaseMapCmd(float value) { efiPrintf("Setting whole injection phase map to %.2f", value); -#if IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT - setMap(config->injectionPhase, value); -#endif + setTable(config->injectionPhase, value); } static void setWholeTimingMapCmd(float value) { @@ -512,7 +510,7 @@ static void setWholeVeCmd(float value) { if (engineConfiguration->fuelAlgorithm != LM_SPEED_DENSITY) { efiPrintf("WARNING: setting VE map not in SD mode is pointless"); } - setMap(config->veTable, value); + setTable(config->veTable, value); engine->resetEngineSnifferIfInTestMode(); }