VVT support for VAG trigger #883

This commit is contained in:
rusefi 2020-08-26 20:57:11 -04:00
parent 2bc9ec019a
commit e4386be937
2 changed files with 17 additions and 1 deletions

View File

@ -66,6 +66,7 @@ private:
class Engine;
class TriggerState;
class TriggerFormDetails;
class TriggerConfiguration;
#define GAP_TRACKING_LENGTH 4
@ -250,6 +251,11 @@ public:
* See findTriggerZeroEventIndex()
*/
int triggerShapeSynchPointIndex;
void initializeSyncPoint(TriggerState *state,
const TriggerConfiguration * triggerConfiguration,
trigger_config_s const*triggerConfig);
private:
trigger_shape_helper h;

View File

@ -114,6 +114,16 @@ float actualSynchGap;
static Logging * logger = nullptr;
void TriggerWaveform::initializeSyncPoint(TriggerState *state,
const TriggerConfiguration * triggerConfiguration,
trigger_config_s const*triggerConfig) {
triggerShapeSynchPointIndex = state->findTriggerZeroEventIndex(this,
triggerConfiguration, triggerConfig);
}
/**
* Calculate 'shape.triggerShapeSynchPointIndex' value using 'TriggerState *state'
*/
void calculateTriggerSynchPoint(TriggerWaveform *shape,
TriggerState *state DECLARE_ENGINE_PARAMETER_SUFFIX) {
#if EFI_PROD_CODE
@ -122,7 +132,7 @@ void calculateTriggerSynchPoint(TriggerWaveform *shape,
trigger_config_s const*triggerConfig = &engineConfiguration->trigger;
engine->triggerErrorDetection.clear();
shape->triggerShapeSynchPointIndex = state->findTriggerZeroEventIndex(shape,
shape->initializeSyncPoint(state,
&engine->primaryTriggerConfiguration,
triggerConfig);