use setTable (#2621)

This commit is contained in:
Matthew Kennedy 2021-05-04 09:03:41 -05:00 committed by GitHub
parent a62b7bedb2
commit bb0662791b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 29 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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();
}