reduing RAM usage by not having unneeded second copy of calibration table

This commit is contained in:
rusefi 2024-07-30 20:47:35 -04:00
parent bd90c617d7
commit 971f510ee0
5 changed files with 15 additions and 14 deletions

View File

@ -887,7 +887,7 @@ void fuelBenchMode() {
#if EFI_ENGINE_CONTROL
setFlatInjectorLag(0);
#endif // EFI_ENGINE_CONTROL
setTable(engineConfiguration->postCrankingFactor, 1.0f);
setTable(config->postCrankingFactor, 1.0f);
setArrayValues(config->crankingFuelCoef, 1.0f);
setTable(config->crankingCycleFuelCoef, 1.0f);
setBasicNotECUmode();

View File

@ -46,8 +46,8 @@ void setHondaK() {
static const uint16_t defaultPostCrankinDurationBins[] = {
0, 65, 100, 125, 150, 250
};
copyArray(engineConfiguration->postCrankingDurationBins, defaultPostCrankinDurationBins);
setTable(engineConfiguration->postCrankingFactor, 1.25f);
copyArray(config->postCrankingDurationBins, defaultPostCrankinDurationBins);
setTable(config->postCrankingFactor, 1.25f);
engineConfiguration->useRunningMathForCranking = true;
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_HONDA);

View File

@ -30,9 +30,9 @@ void setDefaultCranking() {
static const uint16_t defaultPostCrankinDurationBins[] = {
0, 15, 35, 65, 100, 150
};
copyArray(engineConfiguration->postCrankingCLTBins, defaultPostCrankingCLTBins);
copyArray(engineConfiguration->postCrankingDurationBins, defaultPostCrankinDurationBins);
setTable(engineConfiguration->postCrankingFactor, 1.2f);
copyArray(config->postCrankingCLTBins, defaultPostCrankingCLTBins);
copyArray(config->postCrankingDurationBins, defaultPostCrankinDurationBins);
setTable(config->postCrankingFactor, 1.2f);
#endif
setLinearCurve(config->crankingTpsCoef, /*from*/1, /*to*/1, 1);

View File

@ -133,13 +133,13 @@ void EngineState::periodicFastCallback() {
// post-cranking fuel enrichment.
float m_postCrankingFactor = interpolate3d(
engineConfiguration->postCrankingFactor,
engineConfiguration->postCrankingCLTBins, Sensor::getOrZero(SensorType::Clt),
engineConfiguration->postCrankingDurationBins, engine->rpmCalculator.getRevolutionCounterSinceStart()
config->postCrankingFactor,
config->postCrankingCLTBins, Sensor::getOrZero(SensorType::Clt),
config->postCrankingDurationBins, engine->rpmCalculator.getRevolutionCounterSinceStart()
);
// for compatibility reasons, apply only if the factor is greater than unity (only allow adding fuel)
// if the engine run time is past the last bin, disable ASE in case the table is filled with values more than 1.0, helps with compatibility
if ((m_postCrankingFactor < 1.0f) || (engine->rpmCalculator.getRevolutionCounterSinceStart() > engineConfiguration->postCrankingDurationBins[efi::size(engineConfiguration->postCrankingDurationBins)-1])) {
if ((m_postCrankingFactor < 1.0f) || (engine->rpmCalculator.getRevolutionCounterSinceStart() > config->postCrankingDurationBins[efi::size(config->postCrankingDurationBins)-1])) {
m_postCrankingFactor = 1.0f;
}
engine->fuelComputer.running.postCrankingFuelCorrection = m_postCrankingFactor;

View File

@ -1339,10 +1339,6 @@ tle8888_mode_e tle8888mode;
pin_output_mode_e fan2PinMode;
float fuelReferencePressure;This is the pressure at which your injector flow is known.\nFor example if your injectors flow 400cc/min at 3.5 bar, enter 350kpa here.;"kPa", 1, 0, 50, 700000, 0
float[CRANKING_ENRICH_COUNT x CRANKING_ENRICH_COUNT] postCrankingFactor;;"mult", 1, 0, 1, 3, 2
float[CRANKING_ENRICH_COUNT] postCrankingDurationBins;;"count", 1, 0, 0, 1000, 0
int16_t[CRANKING_ENRICH_COUNT] postCrankingCLTBins;;"C", 1, 0, -100, @@CLT_UPPER_LIMIT@@, 0
ThermistorConf auxTempSensor1
ThermistorConf auxTempSensor2
int16_t knockSamplingDuration;;"Deg", 1, 0, 0, 720, 0
@ -1712,6 +1708,11 @@ end_struct
! note that this magic field name is used by LiveDataParserPanel
engine_configuration_s engineConfiguration;
float[CRANKING_ENRICH_COUNT x CRANKING_ENRICH_COUNT] postCrankingFactor;;"mult", 1, 0, 1, 3, 2
float[CRANKING_ENRICH_COUNT] postCrankingDurationBins;;"count", 1, 0, 0, 1000, 0
int16_t[CRANKING_ENRICH_COUNT] postCrankingCLTBins;;"C", 1, 0, -100, @@CLT_UPPER_LIMIT@@, 0
float[ETB_BIAS_CURVE_LENGTH] etbBiasBins;target TPS value, 0 to 100%\nTODO: use int8 data date once we template interpolation method;"target TPS position", 1, 0, 0, 100, 0
float[ETB_BIAS_CURVE_LENGTH] etbBiasValues;PWM bias, 0 to 100%;"ETB duty cycle bias", 1, 0, -100, 100, 2