M62T vanos support #2243
This commit is contained in:
parent
7b6e402089
commit
dc80e4e6cb
|
@ -47,7 +47,9 @@ WaveChart waveChart;
|
||||||
trigger_central_s::trigger_central_s() : hwEventCounters() {
|
trigger_central_s::trigger_central_s() : hwEventCounters() {
|
||||||
}
|
}
|
||||||
|
|
||||||
TriggerCentral::TriggerCentral() : trigger_central_s(), vvtSyncTimeNt() {
|
TriggerCentral::TriggerCentral() : trigger_central_s(),
|
||||||
|
vvtPosition(),
|
||||||
|
vvtSyncTimeNt() {
|
||||||
triggerState.resetTriggerState();
|
triggerState.resetTriggerState();
|
||||||
noiseFilter.resetAccumSignalData();
|
noiseFilter.resetAccumSignalData();
|
||||||
}
|
}
|
||||||
|
@ -76,7 +78,7 @@ EXTERN_ENGINE;
|
||||||
static Logging *logger;
|
static Logging *logger;
|
||||||
|
|
||||||
angle_t TriggerCentral::getVVTPosition() {
|
angle_t TriggerCentral::getVVTPosition() {
|
||||||
return vvtPosition;
|
return vvtPosition[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
#define miataNbIndex (0)
|
#define miataNbIndex (0)
|
||||||
|
@ -176,7 +178,10 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt DECLARE_ENGINE_
|
||||||
currentPosition -= tdcPosition();
|
currentPosition -= tdcPosition();
|
||||||
// https://github.com/rusefi/rusefi/issues/1713 currentPosition could be negative that's expected
|
// https://github.com/rusefi/rusefi/issues/1713 currentPosition could be negative that's expected
|
||||||
|
|
||||||
|
#if EFI_UNIT_TEST
|
||||||
tc->currentVVTEventPosition = currentPosition;
|
tc->currentVVTEventPosition = currentPosition;
|
||||||
|
#endif // EFI_UNIT_TEST
|
||||||
|
|
||||||
if (engineConfiguration->debugMode == DBG_VVT) {
|
if (engineConfiguration->debugMode == DBG_VVT) {
|
||||||
#if EFI_TUNER_STUDIO
|
#if EFI_TUNER_STUDIO
|
||||||
tsOutputChannels.debugFloatField1 = currentPosition;
|
tsOutputChannels.debugFloatField1 = currentPosition;
|
||||||
|
@ -214,8 +219,8 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt DECLARE_ENGINE_
|
||||||
|
|
||||||
// we do NOT clamp VVT position into the [0, engineCycle) range - we expect vvtOffset to be configured so that
|
// we do NOT clamp VVT position into the [0, engineCycle) range - we expect vvtOffset to be configured so that
|
||||||
// it's not necessary
|
// it's not necessary
|
||||||
tc->vvtPosition = engineConfiguration->vvtOffset - currentPosition;
|
tc->vvtPosition[bankIndex] = engineConfiguration->vvtOffset - currentPosition;
|
||||||
if (tc->vvtPosition < 0 || tc->vvtPosition > ENGINE(engineCycle)) {
|
if (tc->vvtPosition[bankIndex] < 0 || tc->vvtPosition[bankIndex] > ENGINE(engineCycle)) {
|
||||||
warning(CUSTOM_ERR_VVT_OUT_OF_RANGE, "Please adjust vvtOffset since position %f", tc->vvtPosition);
|
warning(CUSTOM_ERR_VVT_OUT_OF_RANGE, "Please adjust vvtOffset since position %f", tc->vvtPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,10 +54,13 @@ public:
|
||||||
trigger_type_e vvtTriggerType;
|
trigger_type_e vvtTriggerType;
|
||||||
angle_t getVVTPosition();
|
angle_t getVVTPosition();
|
||||||
|
|
||||||
|
#if EFI_UNIT_TEST
|
||||||
// latest VVT event position (could be not synchronization event)
|
// latest VVT event position (could be not synchronization event)
|
||||||
angle_t currentVVTEventPosition = 0;
|
angle_t currentVVTEventPosition = 0;
|
||||||
|
#endif // EFI_UNIT_TEST
|
||||||
|
|
||||||
// synchronization event position
|
// synchronization event position
|
||||||
angle_t vvtPosition = 0;
|
angle_t vvtPosition[BANKS_COUNT];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this is similar to TriggerState#startOfCycleNt but with the crank-only sensor magic
|
* this is similar to TriggerState#startOfCycleNt but with the crank-only sensor magic
|
||||||
|
|
Loading…
Reference in New Issue