VVT support for VAG trigger #883
This commit is contained in:
parent
c9ad86ad06
commit
70cdbc51b7
|
@ -73,6 +73,21 @@ void Engine::resetEngineSnifferIfInTestMode() {
|
|||
#endif /* EFI_ENGINE_SNIFFER */
|
||||
}
|
||||
|
||||
trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode) {
|
||||
switch (vvtMode) {
|
||||
case VVT_2JZ:
|
||||
return TT_VVT_JZ;
|
||||
case MIATA_NB2:
|
||||
return TT_VVT_MIATA_NB2;
|
||||
case VVT_FIRST_HALF:
|
||||
return TT_ONE;
|
||||
case VVT_SECOND_HALF:
|
||||
return TT_ONE;
|
||||
default:
|
||||
return TT_ONE;
|
||||
}
|
||||
}
|
||||
|
||||
void Engine::initializeTriggerWaveform(Logging *logger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
|
||||
// we have a confusing threading model so some synchronization would not hurt
|
||||
|
@ -106,6 +121,19 @@ void Engine::initializeTriggerWaveform(Logging *logger DECLARE_ENGINE_PARAMETER_
|
|||
engine->engineCycleEventCount = TRIGGER_WAVEFORM(getLength());
|
||||
}
|
||||
|
||||
|
||||
if (engineConfiguration->vvtMode != VVT_INACTIVE) {
|
||||
trigger_config_s config;
|
||||
config.type = getVvtTriggerType(engineConfiguration->vvtMode);
|
||||
|
||||
ENGINE(triggerCentral).vvtShape.initializeTriggerWaveform(logger,
|
||||
engineConfiguration->ambiguousOperationMode,
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger, &config);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!alreadyLocked) {
|
||||
unlockAnyContext();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue