M62T vanos support #2243

This commit is contained in:
rusefillc 2021-01-26 21:43:23 -05:00
parent 01fd8ac18a
commit c0e9d2914b
3 changed files with 8 additions and 7 deletions

View File

@ -225,10 +225,11 @@ static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
efitick_t nowNt = getTimeNowNt();
if (nowNt - engine->triggerCentral.vvtSyncTimeNt >= NT_PER_SECOND) {
// loss of VVT sync
engine->triggerCentral.vvtSyncTimeNt = 0;
for (int bankIndex = 0; bankIndex < BANKS_COUNT; bankIndex++) {
if (nowNt - engine->triggerCentral.vvtSyncTimeNt[bankIndex] >= NT_PER_SECOND) {
// loss of VVT sync
engine->triggerCentral.vvtSyncTimeNt[bankIndex] = 0;
}
}
// for performance reasons this assertion related to mainTriggerCallback should better be here

View File

@ -47,7 +47,7 @@ WaveChart waveChart;
trigger_central_s::trigger_central_s() : hwEventCounters() {
}
TriggerCentral::TriggerCentral() : trigger_central_s() {
TriggerCentral::TriggerCentral() : trigger_central_s(), vvtSyncTimeNt() {
triggerState.resetTriggerState();
noiseFilter.resetAccumSignalData();
}
@ -210,7 +210,7 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt DECLARE_ENGINE_
break;
}
tc->vvtSyncTimeNt = nowNt;
tc->vvtSyncTimeNt[bankIndex] = nowNt;
// we do NOT clamp VVT position into the [0, engineCycle) range - we expect vvtOffset to be configured so that
// it's not necessary

View File

@ -64,7 +64,7 @@ public:
*/
efitick_t timeAtVirtualZeroNt = 0;
efitick_t vvtSyncTimeNt = 0;
efitick_t vvtSyncTimeNt[BANKS_COUNT];
TriggerStateWithRunningStatistics triggerState;
TriggerWaveform triggerShape;