M62T vanos support #2243

This commit is contained in:
rusefillc 2021-02-08 22:07:14 -05:00
parent 2d99e77c95
commit 081357ca5e
3 changed files with 9 additions and 6 deletions

View File

@ -103,10 +103,13 @@ trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode) {
}
}
static void initVvtShape(Logging *logger, vvt_mode_e vvtMode, TriggerWaveform *shape, TriggerState &initState DECLARE_ENGINE_PARAMETER_SUFFIX) {
static void initVvtShape(Logging *logger, int index, TriggerState &initState DECLARE_ENGINE_PARAMETER_SUFFIX) {
vvt_mode_e vvtMode = engineConfiguration->vvtMode[index];
TriggerWaveform *shape = &ENGINE(triggerCentral).vvtShape[index];
if (vvtMode != VVT_INACTIVE) {
trigger_config_s config;
ENGINE(triggerCentral).vvtTriggerType = config.type = getVvtTriggerType(vvtMode);
ENGINE(triggerCentral).vvtTriggerType[index] = config.type = getVvtTriggerType(vvtMode);
shape->initializeTriggerWaveform(logger,
engineConfiguration->ambiguousOperationMode,
@ -147,8 +150,8 @@ void Engine::initializeTriggerWaveform(Logging *logger DECLARE_ENGINE_PARAMETER_
}
initVvtShape(logger, engineConfiguration->vvtMode[0], &ENGINE(triggerCentral).vvtShape[0], initState PASS_ENGINE_PARAMETER_SUFFIX);
initVvtShape(logger, engineConfiguration->vvtMode[1], &ENGINE(triggerCentral).vvtShape[1], initState PASS_ENGINE_PARAMETER_SUFFIX);
initVvtShape(logger, 0, initState PASS_ENGINE_PARAMETER_SUFFIX);
initVvtShape(logger, 1, initState PASS_ENGINE_PARAMETER_SUFFIX);
if (!TRIGGER_WAVEFORM(shapeDefinitionError)) {

View File

@ -283,7 +283,7 @@ bool VvtTriggerConfiguration::isUseOnlyRisingEdgeForTrigger() const {
}
trigger_type_e VvtTriggerConfiguration::getType() const {
return engine->triggerCentral.vvtTriggerType;
return engine->triggerCentral.vvtTriggerType[0];
}
bool VvtTriggerConfiguration::isVerboseTriggerSynchDetails() const {

View File

@ -56,7 +56,7 @@ public:
TriggerNoiseFilter noiseFilter;
trigger_type_e vvtTriggerType;
trigger_type_e vvtTriggerType[CAMS_PER_BANK];
angle_t getVVTPosition();
#if EFI_UNIT_TEST