progress towards #961
This commit is contained in:
parent
9c3492043d
commit
68db5ecdb1
|
@ -859,10 +859,11 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
||||||
tsOutputChannels->speedToRpmRatio = vehicleSpeed / rpm;
|
tsOutputChannels->speedToRpmRatio = vehicleSpeed / rpm;
|
||||||
|
|
||||||
#endif /* EFI_VEHICLE_SPEED */
|
#endif /* EFI_VEHICLE_SPEED */
|
||||||
tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature());
|
|
||||||
tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature());
|
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
|
tsOutputChannels->isCltError = !hasCltSensor();
|
||||||
|
tsOutputChannels->isIatError = !hasIatSensor();
|
||||||
|
|
||||||
tsOutputChannels->fuelConsumptionPerHour = engine->engineState.fuelConsumption.perSecondConsumption;
|
tsOutputChannels->fuelConsumptionPerHour = engine->engineState.fuelConsumption.perSecondConsumption;
|
||||||
|
|
||||||
tsOutputChannels->warningCounter = engine->engineState.warnings.warningCounter;
|
tsOutputChannels->warningCounter = engine->engineState.warnings.warningCounter;
|
||||||
|
|
|
@ -113,7 +113,7 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
|
||||||
|
|
||||||
angle_t getAdvanceCorrections(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
angle_t getAdvanceCorrections(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
float iatCorrection;
|
float iatCorrection;
|
||||||
if (cisnan(engine->sensors.iat)) {
|
if (!hasIatSensor()) {
|
||||||
iatCorrection = 0;
|
iatCorrection = 0;
|
||||||
} else {
|
} else {
|
||||||
iatCorrection = iatAdvanceCorrectionMap.getValue((float) rpm, getIntakeAirTemperature());
|
iatCorrection = iatAdvanceCorrectionMap.getValue((float) rpm, getIntakeAirTemperature());
|
||||||
|
|
|
@ -305,13 +305,13 @@ void initFuelMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
* @brief Engine warm-up fuel correction.
|
* @brief Engine warm-up fuel correction.
|
||||||
*/
|
*/
|
||||||
float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
if (cisnan(engine->sensors.clt))
|
if (!hasCltSensor())
|
||||||
return 1; // this error should be already reported somewhere else, let's just handle it
|
return 1; // this error should be already reported somewhere else, let's just handle it
|
||||||
return interpolate2d("cltf", getCoolantTemperature(), config->cltFuelCorrBins, config->cltFuelCorr);
|
return interpolate2d("cltf", getCoolantTemperature(), config->cltFuelCorrBins, config->cltFuelCorr);
|
||||||
}
|
}
|
||||||
|
|
||||||
angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
if (cisnan(engine->sensors.clt))
|
if (!hasCltSensor())
|
||||||
return 0; // this error should be already reported somewhere else, let's just handle it
|
return 0; // this error should be already reported somewhere else, let's just handle it
|
||||||
return interpolate2d("timc", getCoolantTemperature(), engineConfiguration->cltTimingBins, engineConfiguration->cltTimingExtra);
|
return interpolate2d("timc", getCoolantTemperature(), engineConfiguration->cltTimingBins, engineConfiguration->cltTimingExtra);
|
||||||
}
|
}
|
||||||
|
@ -339,7 +339,8 @@ float getFuelCutOffCorrection(efitick_t nowNt, int rpm DECLARE_ENGINE_PARAMETER_
|
||||||
// gather events
|
// gather events
|
||||||
bool mapDeactivate = (map >= CONFIG(coastingFuelCutMap));
|
bool mapDeactivate = (map >= CONFIG(coastingFuelCutMap));
|
||||||
bool tpsDeactivate = (tpsPos >= CONFIG(coastingFuelCutTps));
|
bool tpsDeactivate = (tpsPos >= CONFIG(coastingFuelCutTps));
|
||||||
bool cltDeactivate = cisnan(engine->sensors.clt) ? false : (engine->sensors.clt < (float)CONFIG(coastingFuelCutClt));
|
// If no CLT sensor (or broken), don't allow DFCO
|
||||||
|
bool cltDeactivate = hasCltSensor() ? (getCoolantTemperature() < (float)CONFIG(coastingFuelCutClt)) : true;
|
||||||
bool rpmDeactivate = (rpm < CONFIG(coastingFuelCutRpmLow));
|
bool rpmDeactivate = (rpm < CONFIG(coastingFuelCutRpmLow));
|
||||||
bool rpmActivate = (rpm > CONFIG(coastingFuelCutRpmHigh));
|
bool rpmActivate = (rpm > CONFIG(coastingFuelCutRpmHigh));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue