hard-coding miata Nb2 VVT Ratio magic

This commit is contained in:
rusefi 2020-03-09 16:59:19 -04:00
parent c88656c81d
commit 2ae15b5bab
6 changed files with 17 additions and 23 deletions

View File

@ -193,12 +193,6 @@ static void setMazdaMiataEngineNB2Defaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setCommonNTCSensor(&engineConfiguration->clt, 2700);
setCommonNTCSensor(&engineConfiguration->iat, 2700);
// 0.0825
// 0.1375
// 6.375
// 10.625
engineConfiguration->miataNb2VVTRatioFrom = 8.50 * 0.75;
engineConfiguration->miataNb2VVTRatioTo = 14;
engineConfiguration->nbVvtIndex = 0;
engineConfiguration->auxPidFrequency[0] = 300; // VVT solenoid control

View File

@ -849,6 +849,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 201200308;
return 201200309;
}
#endif /* EFI_UNIT_TEST */

View File

@ -86,6 +86,10 @@ void addTriggerEventListener(ShaftPositionListener listener, const char *name, E
engine->triggerCentral.addEventListener(listener, name, engine);
}
#define miataNb2VVTRatioFrom (8.50 * 0.75)
#define miataNb2VVTRatioTo (14)
void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) {
TriggerCentral *tc = &engine->triggerCentral;
if (front == TV_RISE) {
@ -121,7 +125,7 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt DECLARE_ENGINE_
if (engineConfiguration->verboseTriggerSynchDetails) {
scheduleMsg(logger, "vvt ratio %.2f", ratio);
}
if (ratio < CONFIG(miataNb2VVTRatioFrom) || ratio > CONFIG(miataNb2VVTRatioTo)) {
if (ratio < miataNb2VVTRatioFrom || ratio > miataNb2VVTRatioTo) {
return;
}
if (engineConfiguration->verboseTriggerSynchDetails) {
@ -662,8 +666,6 @@ void onConfigurationChangeTriggerCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
isConfigurationChanged(vvtCamSensorUseRise) ||
isConfigurationChanged(vvtOffset) ||
isConfigurationChanged(vvtDisplayInverted) ||
isConfigurationChanged(miataNb2VVTRatioFrom) ||
isConfigurationChanged(miataNb2VVTRatioTo) ||
isConfigurationChanged(nbVvtIndex);
if (changed) {
assertEngineReference();

View File

@ -681,8 +681,8 @@ custom uart_device_e 1 bits,U32, @OFFSET@, [0:7], "Off", "UART1", "UART2", "UA
int mapMinBufferLength;;"count", 1, 0, 0, 24, 0
int16_t idlePidDeactivationTpsThreshold;;"%", 1, 0, 0, 100.0, 0
int16_t stepperParkingExtraSteps;;"%", 1, 0, 0, 3000.0, 0
float miataNb2VVTRatioFrom;This magic property is specific to Mazda Miata NB2;"value", 1, 0, 0, 1000, 5
float miataNb2VVTRatioTo;This magic property is specific to Mazda Miata NB2;"value", 1, 0, 0, 1000, 5
float unusedmiataNb2VVTRatioFrom;This magic property is specific to Mazda Miata NB2;"value", 1, 0, 0, 1000, 5
float unusedmiataNb2VVTRatioTo;This magic property is specific to Mazda Miata NB2;"value", 1, 0, 0, 1000, 5
brain_pin_e triggerErrorPin;+This pin is used for debugging - snap a logic analyzer on it and see if it's ever high
pin_output_mode_e triggerErrorPinMode;

View File

@ -1547,8 +1547,6 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "VVT use rise front", vvtCamSensorUseRise, {trigger_type != 80}
field = "VVT position display offset", vvtOffset
field = "VVT display inverted", vvtDisplayInverted
field = "Miata NB2 from (temporary)", miataNb2VVTRatioFrom
field = "Miata NB2 to (temporary)", miataNb2VVTRatioTo
field = "nbVvtIndex", nbVvtIndex
field = "print verbose sync details to console",verboseTriggerSynchDetails
field = "Do not print messages in case of sync error", silentTriggerError

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sun Mar 08 09:00:07 EDT 2020
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Mon Mar 09 16:42:12 EDT 2020
// by class com.rusefi.output.FileJavaFieldsConsumer
import com.rusefi.config.*;
@ -1034,10 +1034,6 @@ public class Fields {
public static final int mc33972_csPinMode_offset = 679;
public static final int mc33972spiDevice_offset = 4008;
public static final int measureMapOnlyInOneCylinder_offset = 744;
public static final int miataNb2VVTRatioFrom_offset = 820;
public static final int miataNb2VVTRatioFrom_offset_hex = 334;
public static final int miataNb2VVTRatioTo_offset = 824;
public static final int miataNb2VVTRatioTo_offset_hex = 338;
public static final String MOCK_AFR_COMMAND = "mock_afr_voltage";
public static final String MOCK_CLT_COMMAND = "mock_clt_voltage";
public static final String MOCK_IAT_COMMAND = "mock_iat_voltage";
@ -1405,6 +1401,10 @@ public class Fields {
public static final int unusedFlexFuelSensor_offset = 3100;
public static final int unusedFormerWarmupAfrPid_offset = 1772;
public static final int unusedHereWeHave_offset = 756;
public static final int unusedmiataNb2VVTRatioFrom_offset = 820;
public static final int unusedmiataNb2VVTRatioFrom_offset_hex = 334;
public static final int unusedmiataNb2VVTRatioTo_offset = 824;
public static final int unusedmiataNb2VVTRatioTo_offset_hex = 338;
public static final int unusedOldWarmupAfr_offset = 744;
public static final int unusedSomething_offset = 1784;
public static final int unusedSpiPadding4_offset = 2593;
@ -1841,8 +1841,8 @@ public class Fields {
public static final Field MAPMINBUFFERLENGTH = Field.create("MAPMINBUFFERLENGTH", 812, FieldType.INT);
public static final Field IDLEPIDDEACTIVATIONTPSTHRESHOLD = Field.create("IDLEPIDDEACTIVATIONTPSTHRESHOLD", 816, FieldType.INT16);
public static final Field STEPPERPARKINGEXTRASTEPS = Field.create("STEPPERPARKINGEXTRASTEPS", 818, FieldType.INT16);
public static final Field MIATANB2VVTRATIOFROM = Field.create("MIATANB2VVTRATIOFROM", 820, FieldType.FLOAT);
public static final Field MIATANB2VVTRATIOTO = Field.create("MIATANB2VVTRATIOTO", 824, FieldType.FLOAT);
public static final Field UNUSEDMIATANB2VVTRATIOFROM = Field.create("UNUSEDMIATANB2VVTRATIOFROM", 820, FieldType.FLOAT);
public static final Field UNUSEDMIATANB2VVTRATIOTO = Field.create("UNUSEDMIATANB2VVTRATIOTO", 824, FieldType.FLOAT);
public static final Field TRIGGERERRORPIN = Field.create("TRIGGERERRORPIN", 828, FieldType.INT8, brain_pin_e);
public static final Field TRIGGERERRORPINMODE = Field.create("TRIGGERERRORPINMODE", 829, FieldType.INT8, pin_output_mode_e);
public static final Field ACRELAYPIN = Field.create("ACRELAYPIN", 830, FieldType.INT8, output_pin_e);
@ -2739,8 +2739,8 @@ public class Fields {
MAPMINBUFFERLENGTH,
IDLEPIDDEACTIVATIONTPSTHRESHOLD,
STEPPERPARKINGEXTRASTEPS,
MIATANB2VVTRATIOFROM,
MIATANB2VVTRATIOTO,
UNUSEDMIATANB2VVTRATIOFROM,
UNUSEDMIATANB2VVTRATIOTO,
TRIGGERERRORPIN,
TRIGGERERRORPINMODE,
ACRELAYPIN,