fix #472
This commit is contained in:
parent
88e1c34c40
commit
35c5240699
|
@ -98,6 +98,13 @@ void hwHandleVvtCamSignal(trigger_value_e front) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
floatus_t oneDegreeUs = engine->rpmCalculator.oneDegreeUs;
|
||||||
|
if (cisnan(oneDegreeUs)) {
|
||||||
|
// we are here if we are getting VVT position signals while engine is not running
|
||||||
|
// for example if crank position sensor is broken :)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
TriggerCentral *tc = &engine->triggerCentral;
|
TriggerCentral *tc = &engine->triggerCentral;
|
||||||
|
|
||||||
efitick_t nowNt = getTimeNowNt();
|
efitick_t nowNt = getTimeNowNt();
|
||||||
|
@ -124,7 +131,7 @@ void hwHandleVvtCamSignal(trigger_value_e front) {
|
||||||
|
|
||||||
efitick_t offsetNt = nowNt - tc->timeAtVirtualZeroNt;
|
efitick_t offsetNt = nowNt - tc->timeAtVirtualZeroNt;
|
||||||
|
|
||||||
angle_t vvtPosition = NT2US(offsetNt) / engine->rpmCalculator.oneDegreeUs;
|
angle_t vvtPosition = NT2US(offsetNt) / oneDegreeUs;
|
||||||
|
|
||||||
// convert engine cycle angle into trigger cycle angle
|
// convert engine cycle angle into trigger cycle angle
|
||||||
vvtPosition -= tdcPosition();
|
vvtPosition -= tdcPosition();
|
||||||
|
|
Loading…
Reference in New Issue