VVT support for VAG trigger #883

This commit is contained in:
rusefi 2020-08-29 18:37:13 -04:00
parent dc11832184
commit 50ff019711
1 changed files with 6 additions and 1 deletions

View File

@ -87,6 +87,10 @@ void addTriggerEventListener(ShaftPositionListener listener, const char *name, E
#define miataNbIndex (0)
static bool vvtWithRealDecoder(vvt_mode_e vvtMode) {
return vvtMode == MIATA_NB2 || vvtMode == VVT_BOSCH_QUICK_START;
}
void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) {
TriggerCentral *tc = &engine->triggerCentral;
if (front == TV_RISE) {
@ -108,7 +112,8 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt DECLARE_ENGINE_
}
if (CONFIG(vvtCamSensorUseRise) ^ (front != TV_FALL)) {
if (!vvtWithRealDecoder(engineConfiguration->vvtMode) && (CONFIG(vvtCamSensorUseRise) ^ (front != TV_FALL))) {
// todo: there should be a way to always use real trigger code for this logic?
return;
}