Gear detection based on RPM to VSS ratio #3779
This commit is contained in:
parent
b005a049e2
commit
4a902bb68e
|
@ -544,8 +544,8 @@ void setMazdaMiata2003EngineConfigurationBoardTest() {
|
|||
}
|
||||
|
||||
static void setMiataNB2_MRE_common() {
|
||||
#if (BOARD_TLE8888_COUNT > 0)
|
||||
setMazdaMiataEngineNB2Defaults();
|
||||
#if (BOARD_TLE8888_COUNT > 0)
|
||||
|
||||
// MRE has a special main relay control low side pin - rusEfi firmware is totally not involved with main relay control
|
||||
//
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package com.rusefi.native_;
|
||||
|
||||
import com.opensr5.ConfigurationImage;
|
||||
import com.rusefi.config.Field;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.core.Sensor;
|
||||
import com.rusefi.enums.SensorType;
|
||||
import org.junit.Test;
|
||||
|
@ -7,6 +10,7 @@ import org.junit.Test;
|
|||
import java.nio.ByteBuffer;
|
||||
|
||||
import static com.rusefi.config.generated.Fields.TS_FILE_VERSION;
|
||||
import static com.rusefi.config.generated.Fields.engine_type_e_MRE_MIATA_NB2_MAP;
|
||||
import static com.rusefi.shared.FileUtil.littleEndianWrap;
|
||||
import static junit.framework.Assert.*;
|
||||
|
||||
|
@ -34,6 +38,15 @@ public class JniUnitTest {
|
|||
assertEquals(4000.0, getValue(engineLogic.getOutputs(), Sensor.RPM));
|
||||
|
||||
assertEquals(18.11, getValue(engineLogic.getOutputs(), Sensor.runningFuel));
|
||||
|
||||
engineLogic.setEngineType(engine_type_e_MRE_MIATA_NB2_MAP);
|
||||
assertEquals(2.45, getField(engineLogic, Fields.GEARRATIO1));
|
||||
}
|
||||
|
||||
private double getField(EngineLogic engineLogic, Field gearratio1) {
|
||||
byte[] configuration = engineLogic.getConfiguration();
|
||||
assertNotNull("configuration", configuration);
|
||||
return gearratio1.getValue(new ConfigurationImage(configuration), gearratio1.getScale());
|
||||
}
|
||||
|
||||
private double getValue(byte[] outputs, Sensor sensor) {
|
||||
|
|
Loading…
Reference in New Issue