VVT support for VAG trigger #883
This commit is contained in:
parent
14a2b6abad
commit
2971230711
|
@ -895,6 +895,8 @@ static void enableOrDisable(const char *param, bool isEnabled) {
|
||||||
engineConfiguration->verboseTriggerSynchDetails = isEnabled;
|
engineConfiguration->verboseTriggerSynchDetails = isEnabled;
|
||||||
} else if (strEqualCaseInsensitive(param, "vvt_details")) {
|
} else if (strEqualCaseInsensitive(param, "vvt_details")) {
|
||||||
engineConfiguration->verboseVVTDecoding = isEnabled;
|
engineConfiguration->verboseVVTDecoding = isEnabled;
|
||||||
|
} else if (strEqualCaseInsensitive(param, "invertCamVVTSignal")) {
|
||||||
|
engineConfiguration->invertCamVVTSignal = isEnabled;
|
||||||
} else if (strEqualCaseInsensitive(param, CMD_IGNITION)) {
|
} else if (strEqualCaseInsensitive(param, CMD_IGNITION)) {
|
||||||
engineConfiguration->isIgnitionEnabled = isEnabled;
|
engineConfiguration->isIgnitionEnabled = isEnabled;
|
||||||
} else if (strEqualCaseInsensitive(param, CMD_SELF_STIMULATION)) {
|
} else if (strEqualCaseInsensitive(param, CMD_SELF_STIMULATION)) {
|
||||||
|
@ -1077,6 +1079,8 @@ static void getValue(const char *paramStr) {
|
||||||
scheduleMsg(&logger, "is_enabled_spi_3=%s", boolToString(engineConfiguration->is_enabled_spi_3));
|
scheduleMsg(&logger, "is_enabled_spi_3=%s", boolToString(engineConfiguration->is_enabled_spi_3));
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "vvtCamSensorUseRise")) {
|
} else if (strEqualCaseInsensitive(paramStr, "vvtCamSensorUseRise")) {
|
||||||
scheduleMsg(&logger, "vvtCamSensorUseRise=%s", boolToString(engineConfiguration->vvtCamSensorUseRise));
|
scheduleMsg(&logger, "vvtCamSensorUseRise=%s", boolToString(engineConfiguration->vvtCamSensorUseRise));
|
||||||
|
} else if (strEqualCaseInsensitive(paramStr, "invertCamVVTSignal")) {
|
||||||
|
scheduleMsg(&logger, "invertCamVVTSignal=%s", boolToString(engineConfiguration->invertCamVVTSignal));
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "isHip9011Enabled")) {
|
} else if (strEqualCaseInsensitive(paramStr, "isHip9011Enabled")) {
|
||||||
scheduleMsg(&logger, "isHip9011Enabled=%d", engineConfiguration->isHip9011Enabled);
|
scheduleMsg(&logger, "isHip9011Enabled=%d", engineConfiguration->isHip9011Enabled);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ static void cam_callback(void *arg) {
|
||||||
|
|
||||||
bool rise = (palReadLine(pal_line) == PAL_HIGH);
|
bool rise = (palReadLine(pal_line) == PAL_HIGH);
|
||||||
|
|
||||||
if (rise) {
|
if (rise ^ engineConfiguration->invertCamVVTSignal) {
|
||||||
hwHandleVvtCamSignal(TV_RISE, stamp);
|
hwHandleVvtCamSignal(TV_RISE, stamp);
|
||||||
} else {
|
} else {
|
||||||
hwHandleVvtCamSignal(TV_FALL, stamp);
|
hwHandleVvtCamSignal(TV_FALL, stamp);
|
||||||
|
|
|
@ -38,7 +38,7 @@ static void vvtRisingCallback(void *) {
|
||||||
LogTriggerTooth(SHAFT_SECONDARY_RISING, now);
|
LogTriggerTooth(SHAFT_SECONDARY_RISING, now);
|
||||||
}
|
}
|
||||||
#endif /* EFI_TOOTH_LOGGER */
|
#endif /* EFI_TOOTH_LOGGER */
|
||||||
hwHandleVvtCamSignal(TV_RISE, now);
|
hwHandleVvtCamSignal(engineConfiguration->invertCamVVTSignal ? TV_FALL : TV_RISE, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vvtFallingCallback(void *) {
|
static void vvtFallingCallback(void *) {
|
||||||
|
@ -51,7 +51,7 @@ static void vvtFallingCallback(void *) {
|
||||||
LogTriggerTooth(SHAFT_SECONDARY_FALLING, now);
|
LogTriggerTooth(SHAFT_SECONDARY_FALLING, now);
|
||||||
}
|
}
|
||||||
#endif /* EFI_TOOTH_LOGGER */
|
#endif /* EFI_TOOTH_LOGGER */
|
||||||
hwHandleVvtCamSignal(TV_FALL, now);
|
hwHandleVvtCamSignal(engineConfiguration->invertCamVVTSignal ? TV_RISE : TV_FALL, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1607,6 +1607,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
|
||||||
field = "Secondary channel", triggerInputPins2, { trigger_type != 0 && trigger_type != 8 && trigger_type != 9 && trigger_type != 18 && trigger_type != 20}
|
field = "Secondary channel", triggerInputPins2, { trigger_type != 0 && trigger_type != 8 && trigger_type != 9 && trigger_type != 18 && trigger_type != 20}
|
||||||
field = "Invert Secondary", invertSecondaryTriggerSignal, { trigger_type != 0 && trigger_type != 8 && trigger_type != 9 && trigger_type != 18 && trigger_type != 20}
|
field = "Invert Secondary", invertSecondaryTriggerSignal, { trigger_type != 0 && trigger_type != 8 && trigger_type != 9 && trigger_type != 18 && trigger_type != 20}
|
||||||
field = "Cam Sync/VVT input", camInputs1
|
field = "Cam Sync/VVT input", camInputs1
|
||||||
|
field = "Invert Cam/VVT", invertCamVVTSignal
|
||||||
panel = triggerInputComparator @@if_ts_show_trigger_comparator
|
panel = triggerInputComparator @@if_ts_show_trigger_comparator
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue