Air Conditioning Improvements #4054
This commit is contained in:
parent
6a403abf1f
commit
e1235c4f2e
|
@ -213,7 +213,7 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos,
|
|||
}
|
||||
|
||||
// #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
|
||||
isInDeadZone = !acToggleJustTouched && absI(rpm - targetRpm) <= engineConfiguration->idlePidRpmDeadZone;
|
||||
if (isInDeadZone) {
|
||||
|
|
|
@ -321,7 +321,7 @@ void Engine::updateSwitchInputs() {
|
|||
bool result = getAcToggle();
|
||||
if (engine->acSwitchState != result) {
|
||||
engine->acSwitchState = result;
|
||||
engine->acSwitchLastChangeTime = getTimeNowUs();
|
||||
engine->module<AcController>().unmock().acSwitchLastChangeTimeMs = US2MS(getTimeNowUs());
|
||||
}
|
||||
engine->acSwitchState = result;
|
||||
}
|
||||
|
|
|
@ -353,7 +353,6 @@ public:
|
|||
|
||||
// todo: extract some helper which would contain boolean state and most recent toggle time?
|
||||
bool acSwitchState = false;
|
||||
efitimeus_t acSwitchLastChangeTime = 0;
|
||||
|
||||
bool isRunningPwmTest = false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue