Air Conditioning Improvements #4054
This commit is contained in:
parent
7d61f78b38
commit
905fbd851e
|
@ -213,7 +213,7 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos,
|
||||||
}
|
}
|
||||||
|
|
||||||
// #1553 we need to give FSIO variable offset or minValue a chance
|
// #1553 we need to give FSIO variable offset or minValue a chance
|
||||||
bool acToggleJustTouched = (nowUs - engine->acSwitchLastChangeTime) < MS2US(500);
|
bool acToggleJustTouched = (US2MS(nowUs) - engine->module<AcController>().unmock().acSwitchLastChangeTimeMs) < 500/*ms*/;
|
||||||
// check if within the dead zone
|
// check if within the dead zone
|
||||||
isInDeadZone = !acToggleJustTouched && absI(rpm - targetRpm) <= engineConfiguration->idlePidRpmDeadZone;
|
isInDeadZone = !acToggleJustTouched && absI(rpm - targetRpm) <= engineConfiguration->idlePidRpmDeadZone;
|
||||||
if (isInDeadZone) {
|
if (isInDeadZone) {
|
||||||
|
|
|
@ -321,7 +321,7 @@ void Engine::updateSwitchInputs() {
|
||||||
bool result = getAcToggle();
|
bool result = getAcToggle();
|
||||||
if (engine->acSwitchState != result) {
|
if (engine->acSwitchState != result) {
|
||||||
engine->acSwitchState = result;
|
engine->acSwitchState = result;
|
||||||
engine->acSwitchLastChangeTime = getTimeNowUs();
|
engine->module<AcController>().unmock().acSwitchLastChangeTimeMs = US2MS(getTimeNowUs());
|
||||||
}
|
}
|
||||||
engine->acSwitchState = result;
|
engine->acSwitchState = result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,7 +353,6 @@ public:
|
||||||
|
|
||||||
// todo: extract some helper which would contain boolean state and most recent toggle time?
|
// todo: extract some helper which would contain boolean state and most recent toggle time?
|
||||||
bool acSwitchState = false;
|
bool acSwitchState = false;
|
||||||
efitimeus_t acSwitchLastChangeTime = 0;
|
|
||||||
|
|
||||||
bool isRunningPwmTest = false;
|
bool isRunningPwmTest = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue