From de63a5cd173ec5791c132209edea648be0bb6ef0 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 5 Jul 2021 20:29:49 -0400 Subject: [PATCH] Nissan progress!!! --- .../boards/hellen/hellen121nissan/board_configuration.cpp | 5 ++++- firmware/controllers/trigger/trigger_central.cpp | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp b/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp index 87d131bc30..00156d2c71 100644 --- a/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp @@ -87,6 +87,7 @@ static void setupDefaultSensorInputs() { engineConfiguration->triggerInputPins[2] = GPIO_UNASSIGNED; // Direct hall-only cam input engineConfiguration->camInputs[0] = GPIOA_6; + engineConfiguration->camInputs[1 * 2] = GPIOA_7; engineConfiguration->tps1_1AdcChannel = EFI_ADC_4; engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE; @@ -151,7 +152,7 @@ void setBoardDefaultConfiguration(void) { // engineConfiguration->fuelPumpPin = GPIOG_2; // OUT_IO9 // engineConfiguration->idle.solenoidPin = GPIOD_14; // OUT_PWM5 // engineConfiguration->fanPin = GPIOD_12; // OUT_PWM8 -// engineConfiguration->mainRelayPin = GPIOI_2; // OUT_LOW3 + engineConfiguration->mainRelayPin = GPIOG_14; // pin: 111a, OUT_IO3 // "required" hardware is done - set some reasonable defaults setupDefaultSensorInputs(); @@ -169,6 +170,8 @@ void setBoardDefaultConfiguration(void) { engineConfiguration->specs.cylindersCount = 6; engineConfiguration->specs.firingOrder = FO_1_2_3_4_5_6; engineConfiguration->specs.displacement = 4; + strcpy(CONFIG(engineMake), ENGINE_MAKE_NISSAN); + strcpy(CONFIG(engineCode), "VQ"); engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 43b3a97813..97d3668cd1 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -206,6 +206,11 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECL #endif /* EFI_TUNER_STUDIO */ } + if (index != 0) { + // at the moment we use only primary VVT to sync crank phase + return; + } + switch(engineConfiguration->vvtMode[camIndex]) { case VVT_2JZ: // we do not know if we are in sync or out of sync, so we have to be looking for both possibilities