VVT support for VAG trigger #883

This commit is contained in:
rusefi 2020-08-29 18:13:00 -04:00
parent cc13414bd1
commit 72060dd68f
4 changed files with 8 additions and 3 deletions

View File

@ -895,6 +895,8 @@ static void enableOrDisable(const char *param, bool isEnabled) {
engineConfiguration->verboseTriggerSynchDetails = isEnabled;
} else if (strEqualCaseInsensitive(param, "vvt_details")) {
engineConfiguration->verboseVVTDecoding = isEnabled;
} else if (strEqualCaseInsensitive(param, "invertCamVVTSignal")) {
engineConfiguration->invertCamVVTSignal = isEnabled;
} else if (strEqualCaseInsensitive(param, CMD_IGNITION)) {
engineConfiguration->isIgnitionEnabled = isEnabled;
} 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));
} else if (strEqualCaseInsensitive(paramStr, "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")) {
scheduleMsg(&logger, "isHip9011Enabled=%d", engineConfiguration->isHip9011Enabled);
}

View File

@ -70,7 +70,7 @@ static void cam_callback(void *arg) {
bool rise = (palReadLine(pal_line) == PAL_HIGH);
if (rise) {
if (rise ^ engineConfiguration->invertCamVVTSignal) {
hwHandleVvtCamSignal(TV_RISE, stamp);
} else {
hwHandleVvtCamSignal(TV_FALL, stamp);

View File

@ -38,7 +38,7 @@ static void vvtRisingCallback(void *) {
LogTriggerTooth(SHAFT_SECONDARY_RISING, now);
}
#endif /* EFI_TOOTH_LOGGER */
hwHandleVvtCamSignal(TV_RISE, now);
hwHandleVvtCamSignal(engineConfiguration->invertCamVVTSignal ? TV_FALL : TV_RISE, now);
}
static void vvtFallingCallback(void *) {
@ -51,7 +51,7 @@ static void vvtFallingCallback(void *) {
LogTriggerTooth(SHAFT_SECONDARY_FALLING, now);
}
#endif /* EFI_TOOTH_LOGGER */
hwHandleVvtCamSignal(TV_FALL, now);
hwHandleVvtCamSignal(engineConfiguration->invertCamVVTSignal ? TV_RISE : TV_FALL, now);
}
/**

View File

@ -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 = "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 = "Invert Cam/VVT", invertCamVVTSignal
panel = triggerInputComparator @@if_ts_show_trigger_comparator