vvt: safer syntax

This commit is contained in:
rusefillc 2023-11-11 07:07:08 -05:00 committed by rusefillc
parent ff913e361f
commit 0444a652a9
1 changed files with 2 additions and 1 deletions

View File

@ -61,8 +61,9 @@ expected<angle_t> VvtController::getSetpoint() {
bool enabled = rpm > engineConfiguration->vvtControlMinRpm
&& engine->rpmCalculator.getSecondsSinceEngineStart(getTimeNowNt()) > engineConfiguration->vvtActivationDelayMs / MS_PER_SECOND
;
if (!enabled)
if (!enabled) {
return unexpected;
}
float load = getFuelingLoad();
float target = m_targetMap->getValue(rpm, load);