parent
a5f09ef378
commit
2c8a2b61a5
|
@ -294,7 +294,7 @@ static percent_t automaticIdleController(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
if (CONFIG(idlePidRpmUpperLimit) > 0) {
|
||||
engine->engineState.idle.idleState = PID_UPPER;
|
||||
if (CONFIGB(useIacTableForCoasting) && !cisnan(engine->sensors.clt)) {
|
||||
percent_t iacPosForCoasting = interpolate2d("iacCoasting", engine->sensors.clt, CONFIG(iacCoastingBins), CONFIG(iacCoasting));
|
||||
percent_t iacPosForCoasting = interpolate2d("iacCoasting", getCoolantTemperature(), CONFIG(iacCoastingBins), CONFIG(iacCoasting));
|
||||
newValue = interpolateClamped(idlePidLowerRpm, newValue, idlePidLowerRpm + CONFIG(idlePidRpmUpperLimit), iacPosForCoasting, rpm);
|
||||
} else {
|
||||
// Well, just leave it as is, without PID regulation...
|
||||
|
|
|
@ -116,8 +116,8 @@ void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
engine->engineState.isCrankingState = ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
||||
engine->sensors.iat = getIntakeAirTemperature();
|
||||
engine->sensors.clt = getCoolantTemperature();
|
||||
engine->sensors.iat = getIntakeAirTemperatureM(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
engine->sensors.clt = getCoolantTemperatureM(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// todo: reduce code duplication with 'getCoolantTemperature'
|
||||
if (engineConfiguration->auxTempSensor1.adcChannel != EFI_ADC_NONE) {
|
||||
|
|
|
@ -305,13 +305,13 @@ void initFuelMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (cisnan(engine->sensors.clt))
|
||||
return 1; // this error should be already reported somewhere else, let's just handle it
|
||||
return interpolate2d("cltf", engine->sensors.clt, config->cltFuelCorrBins, config->cltFuelCorr);
|
||||
return interpolate2d("cltf", getCoolantTemperature(), config->cltFuelCorrBins, config->cltFuelCorr);
|
||||
}
|
||||
|
||||
angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (cisnan(engine->sensors.clt))
|
||||
return 0; // this error should be already reported somewhere else, let's just handle it
|
||||
return interpolate2d("timc", engine->sensors.clt, engineConfiguration->cltTimingBins, engineConfiguration->cltTimingExtra);
|
||||
return interpolate2d("timc", getCoolantTemperature(), engineConfiguration->cltTimingBins, engineConfiguration->cltTimingExtra);
|
||||
}
|
||||
|
||||
float getIatFuelCorrection(float iat DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
|
|
|
@ -36,7 +36,11 @@ temperature_t getCoolantTemperatureM(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|||
bool isValidCoolantTemperature(temperature_t temperature);
|
||||
temperature_t getIntakeAirTemperatureM(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
#define getCoolantTemperature() getCoolantTemperatureM(PASS_ENGINE_PARAMETER_SIGNATURE)
|
||||
/**
|
||||
* This macro points to readily-available pre-calculated value
|
||||
* for actual slow calculation see 'getCoolantTemperatureM'
|
||||
*/
|
||||
#define getCoolantTemperature() engine->sensors.clt
|
||||
#define getIntakeAirTemperature() getIntakeAirTemperatureM(PASS_ENGINE_PARAMETER_SIGNATURE)
|
||||
|
||||
bool isValidIntakeAirTemperature(temperature_t temperature);
|
||||
|
|
Loading…
Reference in New Issue