Nissan VVT trigger decoder #2887
This commit is contained in:
parent
346d93879c
commit
e34b04bd46
|
@ -92,7 +92,7 @@ void setMazdaMiata2003EngineConfigurationNaFuelRail(DECLARE_CONFIG_PARAMETER_SIG
|
|||
copyArray(config->veLoadBins, mazda_miata_nb2_LoadBins);
|
||||
copyTable(config->veTable, mapBased18vvtVeTable_NA_fuel_rail);
|
||||
|
||||
engineConfiguration->vvtOffset = 83; // 2002 green car value
|
||||
engineConfiguration->vvtOffsets[0] = 83; // 2002 green car value
|
||||
|
||||
copyArray(config->lambdaRpmBins, mazda_miata_nb2_targetLambdaRpmBins);
|
||||
copyArray(config->lambdaLoadBins, mazda_miata_nb2_targetLambdaLoadBins);
|
||||
|
@ -111,7 +111,7 @@ void setMazdaMiata2003EngineConfigurationNaFuelRail(DECLARE_CONFIG_PARAMETER_SIG
|
|||
|
||||
engineConfiguration->ignitionDwellForCrankingMs = 8;
|
||||
|
||||
engineConfiguration->vvtOffset = 97;
|
||||
engineConfiguration->vvtOffsets[0] = 97;
|
||||
|
||||
|
||||
engineConfiguration->rpmHardLimit = 7200; // we want to survive the race, but we also want some fun!
|
||||
|
|
|
@ -313,7 +313,7 @@ static void setMazdaMiataEngineNB2Defaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
// set vvt_mode 3
|
||||
engineConfiguration->vvtMode[0] = VVT_MIATA_NB2;
|
||||
engineConfiguration->vvtOffset = 98; // 2003 red car value
|
||||
engineConfiguration->vvtOffsets[0] = 98; // 2003 red car value
|
||||
|
||||
copyArray(config->veRpmBins, mazda_miata_nb2_RpmBins);
|
||||
copyArray(config->veLoadBins, mazda_miata_nb2_LoadBins);
|
||||
|
@ -569,7 +569,7 @@ static void setMiataNB2_MRE_common(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
|
||||
engineConfiguration->ignitionDwellForCrankingMs = 8;
|
||||
|
||||
engineConfiguration->vvtOffset = 97;
|
||||
engineConfiguration->vvtOffsets[0] = 97;
|
||||
|
||||
|
||||
// # TLE8888 high current low side: VVT1 IN10 / OUT6
|
||||
|
|
|
@ -1214,7 +1214,7 @@ static void setValue(const char *paramStr, const char *valueStr) {
|
|||
setTriggerEmulatorRPM(valueI);
|
||||
#endif /* EFI_EMULATE_POSITION_SENSORS */
|
||||
} else if (strEqualCaseInsensitive(paramStr, "vvt_offset")) {
|
||||
engineConfiguration->vvtOffset = valueF;
|
||||
engineConfiguration->vvtOffsets[0] = valueF;
|
||||
} else if (strEqualCaseInsensitive(paramStr, "vvt_mode")) {
|
||||
engineConfiguration->vvtMode[0] = (vvt_mode_e)valueI;
|
||||
} else if (strEqualCaseInsensitive(paramStr, "operation_mode")) {
|
||||
|
|
|
@ -239,7 +239,7 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECL
|
|||
|
||||
// we do NOT clamp VVT position into the [0, engineCycle) range - we expect vvtOffset to be configured so that
|
||||
// it's not necessary
|
||||
tc->vvtPosition[bankIndex][camIndex] = engineConfiguration->vvtOffset - currentPosition;
|
||||
tc->vvtPosition[bankIndex][camIndex] = engineConfiguration->vvtOffsets[bankIndex * CAMS_PER_BANK + camIndex] - currentPosition;
|
||||
if (tc->vvtPosition[bankIndex][camIndex] < -ENGINE(engineCycle) / 2 || tc->vvtPosition[bankIndex][camIndex] > ENGINE(engineCycle) / 2) {
|
||||
warning(CUSTOM_ERR_VVT_OUT_OF_RANGE, "Please adjust vvtOffset since position %f", tc->vvtPosition);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ TEST(trigger, testCamInput) {
|
|||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->vvtMode[0] = VVT_FIRST_HALF;
|
||||
engineConfiguration->vvtOffset = 360;
|
||||
engineConfiguration->vvtOffsets[0] = 360;
|
||||
eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engineConfiguration->camInputs[0] = GPIOA_10; // we just need to indicate that we have CAM
|
||||
|
||||
|
|
Loading…
Reference in New Issue