diff --git a/firmware/controllers/algo/defaults/default_fuel.cpp b/firmware/controllers/algo/defaults/default_fuel.cpp index b9227f1178..53deb86593 100644 --- a/firmware/controllers/algo/defaults/default_fuel.cpp +++ b/firmware/controllers/algo/defaults/default_fuel.cpp @@ -78,10 +78,10 @@ static void setDefaultWarmupFuelEnrichment() { } static void setDefaultVETable() { - setRpmTableBin(config->veRpmBins, FUEL_RPM_COUNT); + setRpmTableBin(config->veRpmBins); setTable(config->veTable, 80); - setRpmTableBin(config->baroCorrRpmBins, BARO_CORR_SIZE); + setRpmTableBin(config->baroCorrRpmBins); setLinearCurve(config->baroCorrPressureBins, 75, 105, 1); // Default baro table is all 1.0, we can't recommend a reasonable default here @@ -159,7 +159,7 @@ static void setDefaultLambdaTable() { }; copyArray(config->lambdaLoadBins, mapBins); - setRpmTableBin(config->lambdaRpmBins, FUEL_RPM_COUNT); + setRpmTableBin(config->lambdaRpmBins); static constexpr float rowValues[] = { 1, 1, 1, 1, // 30, 40, 50, 60 kpa @@ -229,9 +229,9 @@ void setDefaultFuel() { // Tables setFuelTablesLoadBin(10, 160); - setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT); + setRpmTableBin(config->injPhaseRpmBins); - setRpmTableBin(engineConfiguration->tpsTspCorrValuesBins, TPS_TPS_ACCEL_CLT_CORR_TABLE); + setRpmTableBin(engineConfiguration->tpsTspCorrValuesBins); setLinearCurve(engineConfiguration->tpsTspCorrValuesBins, 1, 1); setDefaultVETable(); diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index b8e50074f0..ef2ffbfd34 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -371,7 +371,7 @@ void setDefaultGppwmParameters() { } static void setDefaultEngineNoiseTable() { - setRpmTableBin(engineConfiguration->knockNoiseRpmBins, ENGINE_NOISE_CURVE_SIZE); + setRpmTableBin(engineConfiguration->knockNoiseRpmBins); engineConfiguration->knockSamplingDuration = 45; @@ -520,17 +520,17 @@ static void setDefaultEngineConfiguration() { setLinearCurve(engineConfiguration->map.samplingWindow, 50, 50, 1); setLinearCurve(config->vvtTable1LoadBins, 20, 120, 10); - setRpmTableBin(config->vvtTable1RpmBins, SCRIPT_TABLE_8); + setRpmTableBin(config->vvtTable1RpmBins); setLinearCurve(config->vvtTable2LoadBins, 20, 120, 10); - setRpmTableBin(config->vvtTable2RpmBins, SCRIPT_TABLE_8); + setRpmTableBin(config->vvtTable2RpmBins); setLinearCurve(config->scriptTable1LoadBins, 20, 120, 10); - setRpmTableBin(config->scriptTable1RpmBins, SCRIPT_TABLE_8); + setRpmTableBin(config->scriptTable1RpmBins); setLinearCurve(config->scriptTable2LoadBins, 20, 120, 10); - setRpmTableBin(config->scriptTable2RpmBins, SCRIPT_TABLE_8); + setRpmTableBin(config->scriptTable2RpmBins); setLinearCurve(config->scriptTable3LoadBins, 20, 120, 10); - setRpmTableBin(config->scriptTable3RpmBins, SCRIPT_TABLE_8); + setRpmTableBin(config->scriptTable3RpmBins); setLinearCurve(config->scriptTable4LoadBins, 20, 120, 10); - setRpmTableBin(config->scriptTable4RpmBins, SCRIPT_TABLE_8); + setRpmTableBin(config->scriptTable4RpmBins); setDefaultEngineNoiseTable(); diff --git a/firmware/util/containers/table_helper.h b/firmware/util/containers/table_helper.h index 2bac3a0ecd..8f02828168 100644 --- a/firmware/util/containers/table_helper.h +++ b/firmware/util/containers/table_helper.h @@ -190,7 +190,7 @@ void setRpmBin(kType array[], int size, float idleRpm, float topRpm) { /** * initialize RPM table axis using default RPM range */ -template -void setRpmTableBin(kType array[], int size) { - setRpmBin(array, size, 800, 7000); +template +void setRpmTableBin(TValue (&array)[TSize]) { + setRpmBin(array, TSize, 800, 7000); }