per-tooth cam position accounting for offset

This commit is contained in:
Andrey 2023-10-06 14:38:27 -04:00
parent e189430666
commit be3a7a4ef6
1 changed files with 3 additions and 2 deletions

View File

@ -349,6 +349,9 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
return;
}
auto vvtPosition = engineConfiguration->vvtOffsets[bankIndex * CAMS_PER_BANK + camIndex] - currentPosition;
tc->triggerState.vvtToothPosition[index] = vvtPosition;
switch(engineConfiguration->vvtMode[camIndex]) {
case VVT_TOYOTA_3_TOOTH:
{
@ -367,8 +370,6 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
break;
}
auto vvtPosition = engineConfiguration->vvtOffsets[bankIndex * CAMS_PER_BANK + camIndex] - currentPosition;
// this could be just an 'if' but let's have it expandable for future use :)
switch(engineConfiguration->vvtMode[camIndex]) {
case VVT_HONDA_K_INTAKE: