diff --git a/firmware/config/engines/ford_1995_inline_6.cpp b/firmware/config/engines/ford_1995_inline_6.cpp index 6e2c3c9e8c..ed4cd17cf9 100644 --- a/firmware/config/engines/ford_1995_inline_6.cpp +++ b/firmware/config/engines/ford_1995_inline_6.cpp @@ -98,7 +98,6 @@ void setFordInline6(DECLARE_ENGINE_PARAMETER_F) { // engineConfiguration->vbattAdcChannel = 0; // engineConfiguration->mafAdcChannel = EFI_ADC_1; - engineConfiguration->hasMafSensor = true; boardConfiguration->triggerInputPins[0] = GPIOA_8; boardConfiguration->triggerInputPins[1] = GPIOA_5; diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index 9c773c765f..028cf224f7 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -118,8 +118,6 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) { // Denso 195500-2180 engineConfiguration->injector.flow = 265; - engineConfiguration->hasBaroSensor = false; - boardConfiguration->isFastAdcEnabled = true; engineConfiguration->map.sensor.type = MT_DENSO183; engineConfiguration->map.sensor.hwChannel = EFI_ADC_4; diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index 4a797054fb..fa7c62a496 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -70,8 +70,6 @@ static const ignition_table_t mapBased18vvtTimingTable = { void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F); - engineConfiguration->hasMapSensor = true; - engineConfiguration->trigger.type = TT_MIATA_VVT; setOperationMode(engineConfiguration, FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR); engineConfiguration->specs.displacement = 1.8; diff --git a/firmware/config/engines/sachs.cpp b/firmware/config/engines/sachs.cpp index a53dfb88a2..4db3144882 100644 --- a/firmware/config/engines/sachs.cpp +++ b/firmware/config/engines/sachs.cpp @@ -34,9 +34,6 @@ void setSachs(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->trigger.customTotalToothCount = 50; engineConfiguration->trigger.customSkippedToothCount = 2; - engineConfiguration->hasMapSensor = false; - engineConfiguration->hasBaroSensor = false; - engineConfiguration->hasAfrSensor = false; boardConfiguration->useSerialPort = false; // Frankenstein analog input #1: PA1 adc1 MAP diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 148173c723..57afa400b8 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -178,17 +178,20 @@ static void printSensors(Logging *log, bool fileFormat) { reportSensorI(log, fileFormat, "mode", "v", packEngineMode(PASS_ENGINE_PARAMETER_F)); // log column #3 - if (engineConfiguration->hasCltSensor) { + if (hasCltSensor()) { reportSensorF(log, fileFormat, "CLT", "C", getCoolantTemperature(PASS_ENGINE_PARAMETER_F), 2); // log column #4 } - reportSensorF(log, fileFormat, "TPS", "%", getTPS(PASS_ENGINE_PARAMETER_F), 2); // log column #5 + if (hasTpsSensor()) { + reportSensorF(log, fileFormat, "TPS", "%", getTPS(PASS_ENGINE_PARAMETER_F), 2); // log column #5 + } if (hasVBatt(PASS_ENGINE_PARAMETER_F)) { reportSensorF(log, fileFormat, "vbatt", "V", getVBatt(PASS_ENGINE_PARAMETER_F), 2); // log column #6 } - reportSensorF(log, fileFormat, "IAT", "C", getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F), 2); // log column #7 - + if (hasIatSensor()) { + reportSensorF(log, fileFormat, "IAT", "C", getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F), 2); // log column #7 + } if (hasMafSensor()) { reportSensorF(log, fileFormat, "maf", "V", getMaf(PASS_ENGINE_PARAMETER_F), 2); @@ -206,7 +209,7 @@ static void printSensors(Logging *log, bool fileFormat) { } #endif /* EFI_ANALOG_SENSORS */ - if (engineConfiguration->hasAfrSensor) { + if (hasAftSensor(PASS_ENGINE_PARAMETER_F)) { reportSensorF(log, fileFormat, "afr", "AFR", getAfr(PASS_ENGINE_PARAMETER_F), 2); } diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index dd501e4f1c..63096cf9da 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -634,10 +634,6 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->baroSensor.lowValue = 0; engineConfiguration->baroSensor.highValue = 500; - engineConfiguration->hasMapSensor = true; - engineConfiguration->hasTpsSensor = true; - engineConfiguration->hasAfrSensor = true; - engineConfiguration->hasBaroSensor = false; engineConfiguration->isEngineChartEnabled = true; engineConfiguration->useOnlyRisingEdgeForTrigger = false; diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 3a4e393da2..7aef5a433f 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Dec 06 21:51:50 EST 2016 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Dec 17 10:16:55 EST 2016 // begin #ifndef ENGINE_CONFIGURATION_GENERATED_H_ #define ENGINE_CONFIGURATION_GENERATED_H_ @@ -1181,7 +1181,6 @@ typedef struct { */ adc_channel_e mafAdcChannel; /** - * @see hasAfrSensor * offset 584 */ afr_sensor_s afr; @@ -1199,18 +1198,17 @@ typedef struct { */ board_configuration_s bc; /** - * @see isMapAveragingEnabled offset 1488 bit 0 */ - bool hasMapSensor : 1; + bool unusedBit__4 : 1; /** offset 1488 bit 1 */ - bool hasIatSensor : 1; + bool unusedBit__1 : 1; /** offset 1488 bit 2 */ - bool hasBaroSensor : 1; + bool unusedBit__5 : 1; /** offset 1488 bit 3 */ - bool hasAfrSensor : 1; + bool unusedBit__6 : 1; /** offset 1488 bit 4 */ bool useConstantDwellDuringCranking : 1; @@ -1223,7 +1221,7 @@ typedef struct { bool isCanEnabled : 1; /** offset 1488 bit 7 */ - bool hasCltSensor : 1; + bool unusedBit__2 : 1; /** offset 1488 bit 8 */ bool canReadEnabled : 1; @@ -1243,9 +1241,8 @@ typedef struct { offset 1488 bit 13 */ bool isAlternatorControlEnabled : 1; /** - * See mafAdcChannel offset 1488 bit 14 */ - bool hasMafSensor : 1; + bool unusedBit__3 : 1; /** offset 1488 bit 15 */ bool hasTpsSensor : 1; @@ -2021,4 +2018,4 @@ typedef struct { #endif // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Dec 06 21:51:50 EST 2016 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Dec 17 10:16:55 EST 2016 diff --git a/firmware/controllers/algo/idle_controller.cpp b/firmware/controllers/algo/idle_controller.cpp index 9df30b3a72..c9ced28f1b 100644 --- a/firmware/controllers/algo/idle_controller.cpp +++ b/firmware/controllers/algo/idle_controller.cpp @@ -65,8 +65,9 @@ static percent_t setNewValue(IdleValveState *idle, int currentRpm, efitimems_t n bool isTpsLockout(DECLARE_ENGINE_PARAMETER_F) { // if we have TPS sensor, then use it - if (engineConfiguration->hasTpsSensor) + if (hasTpsSensor(PASS_ENGINE_PARAMETER_F)) { return getTPS(PASS_ENGINE_PARAMETER_F) > TPS_IDLE_LOCKOUT; + } // TODO: if no TPS sensor then idle switch is our return true; } diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index fbedb0ba6a..0f771821f3 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -617,8 +617,8 @@ #define frequencyReportingMapInputPin_offset 1484 #define unusedBit__4_offset 1488 #define unusedBit__1_offset 1488 -#define hasBaroSensor_offset 1488 -#define hasAfrSensor_offset 1488 +#define unusedBit__5_offset 1488 +#define unusedBit__6_offset 1488 #define useConstantDwellDuringCranking_offset 1488 #define isEngineChartEnabled_offset 1488 #define isCanEnabled_offset 1488 diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index c20b85c89f..32633a9514 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -329,10 +329,10 @@ static void printAnalogInfo(void) { } printAnalogChannelInfo("AFR", engineConfiguration->afr.hwChannel); - if (engineConfiguration->hasMapSensor) { + if (hasMapSensor(PASS_ENGINE_PARAMETER_F)) { printAnalogChannelInfo("MAP", engineConfiguration->map.sensor.hwChannel); } - if (hasBaroSensor()) { + if (hasBaroSensor(PASS_ENGINE_PARAMETER_F)) { printAnalogChannelInfo("BARO", engineConfiguration->baroSensor.hwChannel); } if (engineConfiguration->externalKnockSenseAdc != EFI_ADC_NONE) { diff --git a/firmware/controllers/lcd_controller.cpp b/firmware/controllers/lcd_controller.cpp index 2c1b5fd5ec..d19ebc5647 100644 --- a/firmware/controllers/lcd_controller.cpp +++ b/firmware/controllers/lcd_controller.cpp @@ -264,14 +264,14 @@ static void showLine(lcd_line_e line, int screenY) { return; #endif case LL_AFR: - if (engineConfiguration->hasAfrSensor) { + if (hasAfrSensor(PASS_ENGINE_PARAMETER_F)) { lcdPrintf("AFR: %f", getAfr()); } else { lcdPrintf("AFR: none"); } return; case LL_MAP: - if (engineConfiguration->hasMapSensor) { + if (hasMapSensor(PASS_ENGINE_PARAMETER_F)) { lcdPrintf("MAP %f", getMap()); } else { lcdPrintf("MAP: none"); diff --git a/firmware/controllers/sensors/ego.cpp b/firmware/controllers/sensors/ego.cpp index 927fcb45f8..f85875eac9 100644 --- a/firmware/controllers/sensors/ego.cpp +++ b/firmware/controllers/sensors/ego.cpp @@ -8,6 +8,10 @@ EXTERN_ENGINE; +bool hasAftSensor(DECLARE_ENGINE_PARAMETER_F) { + return engineConfiguration->afr.hwChannel != EFI_ADC_NONE; +} + float getAfr(DECLARE_ENGINE_PARAMETER_F) { afr_sensor_s * sensor = &engineConfiguration->afr; diff --git a/firmware/controllers/sensors/ego.h b/firmware/controllers/sensors/ego.h index 409a8e95b0..7bf586fb33 100644 --- a/firmware/controllers/sensors/ego.h +++ b/firmware/controllers/sensors/ego.h @@ -15,6 +15,7 @@ #include "engine_configuration.h" float getAfr(DECLARE_ENGINE_PARAMETER_F); +bool hasAftSensor(DECLARE_ENGINE_PARAMETER_F); void setEgoSensor(ego_sensor_e type DECLARE_ENGINE_PARAMETER_S); #endif diff --git a/firmware/controllers/sensors/map.cpp b/firmware/controllers/sensors/map.cpp index b6d4a78353..0f8dd3e3a2 100644 --- a/firmware/controllers/sensors/map.cpp +++ b/firmware/controllers/sensors/map.cpp @@ -134,7 +134,11 @@ float getRawMap(DECLARE_ENGINE_PARAMETER_F) { } bool hasBaroSensor(DECLARE_ENGINE_PARAMETER_F) { - return engineConfiguration->hasBaroSensor && engineConfiguration->baroSensor.hwChannel != EFI_ADC_NONE; + return engineConfiguration->baroSensor.hwChannel != EFI_ADC_NONE; +} + +bool hasMapSensor(DECLARE_ENGINE_PARAMETER_F) { + return engineConfiguration->map.sensor.hwChannel != EFI_ADC_NONE; } float getBaroPressure(DECLARE_ENGINE_PARAMETER_F) { diff --git a/firmware/controllers/sensors/map.h b/firmware/controllers/sensors/map.h index 72d20cb489..f703c4c199 100644 --- a/firmware/controllers/sensors/map.h +++ b/firmware/controllers/sensors/map.h @@ -15,6 +15,8 @@ void initMapDecoder(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S); float getRawMap(DECLARE_ENGINE_PARAMETER_F); float getBaroPressure(DECLARE_ENGINE_PARAMETER_F); bool hasBaroSensor(DECLARE_ENGINE_PARAMETER_F); +bool hasMapSensor(DECLARE_ENGINE_PARAMETER_F); + /** * @return MAP value averaged within a window of measurement */ diff --git a/firmware/controllers/sensors/thermistors.cpp b/firmware/controllers/sensors/thermistors.cpp index 9e183ab11d..e71c4da6ad 100644 --- a/firmware/controllers/sensors/thermistors.cpp +++ b/firmware/controllers/sensors/thermistors.cpp @@ -103,11 +103,15 @@ bool isValidIntakeAirTemperature(float temperature) { return !cisnan(temperature) && temperature > -50 && temperature < 100; } +bool hasCltSensor(DECLARE_ENGINE_PARAMETER_F) { + return engineConfiguration->clt.adcChannel != EFI_ADC_NONE; +} + /** * @return coolant temperature, in Celsius */ float getCoolantTemperature(DECLARE_ENGINE_PARAMETER_F) { - if (engineConfiguration->clt.adcChannel == EFI_ADC_NONE) { + if (!hasCltSensor(PASS_ENGINE_PARAMETER_F)) { return NO_CLT_SENSOR_TEMPERATURE; } float temperature = getTemperatureC(&engineConfiguration->clt, &engine->engineState.cltCurve); @@ -173,11 +177,15 @@ static void prepareThermistorCurve(thermistor_conf_s *tc, thermistor_curve_s * c #endif } +bool hasIatSensor(DECLARE_ENGINE_PARAMETER_F) { + return engineConfiguration->iat.adcChannel != EFI_ADC_NONE; +} + /** * @return Celsius value */ float getIntakeAirTemperature(DECLARE_ENGINE_PARAMETER_F) { - if (engineConfiguration->iat.adcChannel == EFI_ADC_NONE) { + if (!hasIatSensor(PASS_ENGINE_PARAMETER_F)) { return NO_IAT_SENSOR_TEMPERATURE; } float temperature = getTemperatureC(&engineConfiguration->iat, &engine->engineState.iatCurve); diff --git a/firmware/controllers/sensors/thermistors.h b/firmware/controllers/sensors/thermistors.h index 9b31e5e941..4d9a7da744 100644 --- a/firmware/controllers/sensors/thermistors.h +++ b/firmware/controllers/sensors/thermistors.h @@ -38,6 +38,8 @@ float getCoolantTemperature(DECLARE_ENGINE_PARAMETER_F); bool isValidCoolantTemperature(float temperature); float getIntakeAirTemperature(DECLARE_ENGINE_PARAMETER_F); bool isValidIntakeAirTemperature(float temperature); +bool hasIatSensor(DECLARE_ENGINE_PARAMETER_F); +bool hasCltSensor(DECLARE_ENGINE_PARAMETER_F); void setThermistorConfiguration(ThermistorConf * tc, float temp1, float r1, float temp2, float r2, float temp3, float r3); diff --git a/firmware/controllers/sensors/tps.cpp b/firmware/controllers/sensors/tps.cpp index 0c095c7dd1..c89760b749 100644 --- a/firmware/controllers/sensors/tps.cpp +++ b/firmware/controllers/sensors/tps.cpp @@ -117,6 +117,10 @@ percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_F) { return maxF(0, minF(100, result)); } +bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_F) { + return engineConfiguration->tpsAdcChannel != EFI_ADC_NONE; +} + percent_t getTPS(DECLARE_ENGINE_PARAMETER_F) { if (!engineConfiguration->hasTpsSensor) return NO_TPS_MAGIC_VALUE; diff --git a/firmware/controllers/sensors/tps.h b/firmware/controllers/sensors/tps.h index 173c1ea3e3..cdd85eebb7 100644 --- a/firmware/controllers/sensors/tps.h +++ b/firmware/controllers/sensors/tps.h @@ -24,6 +24,7 @@ percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_F); * @return Current TPS position, percent of WOT. 0 means idle and 100 means Wide Open Throttle */ percent_t getTPS(DECLARE_ENGINE_PARAMETER_F); +bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_F); int convertVoltageTo10bitADC(float voltage); int getTPS12bitAdc(DECLARE_ENGINE_PARAMETER_F); float getTPSVoltage(DECLARE_ENGINE_PARAMETER_F); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 2d567822bc..6fcc84a84f 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -381,7 +381,7 @@ struct afr_sensor_s end_struct -afr_sensor_s afr;@see hasAfrSensor +afr_sensor_s afr adc_channel_e pedalPositionChannel; @@ -579,21 +579,21 @@ end_struct custom le_formula_t 200 array, U08, @OFFSET@, [200],"char", 1, 0, 0.0, 3.0, 2 board_configuration_s bc; -bit hasMapSensor;@see isMapAveragingEnabled - bit hasIatSensor - bit hasBaroSensor - bit hasAfrSensor +bit unusedBit__4 + bit unusedBit__1 + bit unusedBit__5 + bit unusedBit__6 bit useConstantDwellDuringCranking bit isEngineChartEnabled;This options enables data for 'engine sniffer' tab in console, which comes at some CPU price bit isCanEnabled - bit hasCltSensor + bit unusedBit__2 bit canReadEnabled bit canWriteEnabled bit hasVehicleSpeedSensor bit isJoystickEnabled bit isGpsEnabled bit isAlternatorControlEnabled - bit hasMafSensor;See mafAdcChannel + bit unusedBit__3 bit hasTpsSensor bit cutFuelOnHardLimit bit cutSparkOnHardLimit diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index d3cb988444..13122cc8ac 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -42,7 +42,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Dec 17 08:49:17 EST 2016 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Dec 17 10:16:55 EST 2016 pageSize = 16376 page = 1 @@ -423,8 +423,8 @@ page = 1 frequencyReportingMapInputPin = bits, U32, 1484, [0:6], "INVALID", "INVALID", "PA2", "PA3", "INVALID", "PA5", "INVALID", "INVALID", "PA8", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "INVALID", "PE7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" unusedBit__4 = bits, U32, 1488, [0:0], "false", "true" unusedBit__1 = bits, U32, 1488, [1:1], "false", "true" - hasBaroSensor = bits, U32, 1488, [2:2], "false", "true" - hasAfrSensor = bits, U32, 1488, [3:3], "false", "true" + unusedBit__5 = bits, U32, 1488, [2:2], "false", "true" + unusedBit__6 = bits, U32, 1488, [3:3], "false", "true" useConstantDwellDuringCranking= bits, U32, 1488, [4:4], "false", "true" isEngineChartEnabled = bits, U32, 1488, [5:5], "false", "true" isCanEnabled = bits, U32, 1488, [6:6], "false", "true" diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 3e40718fd6..26f211c804 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Dec 17 08:49:17 EST 2016 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Dec 17 10:16:55 EST 2016 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int FSIO_ADC_COUNT = 4; @@ -621,8 +621,8 @@ public class Fields { public static final int frequencyReportingMapInputPin_offset = 1484; public static final int unusedBit__4_offset = 1488; public static final int unusedBit__1_offset = 1488; - public static final int hasBaroSensor_offset = 1488; - public static final int hasAfrSensor_offset = 1488; + public static final int unusedBit__5_offset = 1488; + public static final int unusedBit__6_offset = 1488; public static final int useConstantDwellDuringCranking_offset = 1488; public static final int isEngineChartEnabled_offset = 1488; public static final int isCanEnabled_offset = 1488; @@ -1354,8 +1354,8 @@ public class Fields { public static final Field FREQUENCYREPORTINGMAPINPUTPIN = Field.create("FREQUENCYREPORTINGMAPINPUTPIN", 1484, FieldType.INT, brain_input_pin_e); public static final Field UNUSEDBIT__4 = Field.create("UNUSEDBIT__4", 1488, FieldType.BIT, 0); public static final Field UNUSEDBIT__1 = Field.create("UNUSEDBIT__1", 1488, FieldType.BIT, 1); - public static final Field HASBAROSENSOR = Field.create("HASBAROSENSOR", 1488, FieldType.BIT, 2); - public static final Field HASAFRSENSOR = Field.create("HASAFRSENSOR", 1488, FieldType.BIT, 3); + public static final Field UNUSEDBIT__5 = Field.create("UNUSEDBIT__5", 1488, FieldType.BIT, 2); + public static final Field UNUSEDBIT__6 = Field.create("UNUSEDBIT__6", 1488, FieldType.BIT, 3); public static final Field USECONSTANTDWELLDURINGCRANKING = Field.create("USECONSTANTDWELLDURINGCRANKING", 1488, FieldType.BIT, 4); public static final Field ISENGINECHARTENABLED = Field.create("ISENGINECHARTENABLED", 1488, FieldType.BIT, 5); public static final Field ISCANENABLED = Field.create("ISCANENABLED", 1488, FieldType.BIT, 6); diff --git a/unit_tests/test_idle_controller.cpp b/unit_tests/test_idle_controller.cpp index 01d74f46eb..77e796afa7 100644 --- a/unit_tests/test_idle_controller.cpp +++ b/unit_tests/test_idle_controller.cpp @@ -31,10 +31,10 @@ void testIdleController(void) { assertEqualsM("#1", 60.0, is.getIdle(900, time PASS_ENGINE_PARAMETER)); time += 2000; - assertEqualsM("#2", 60.5, is.getIdle(900, time PASS_ENGINE_PARAMETER)); + assertEqualsM("idle#2", 60.0, is.getIdle(900, time PASS_ENGINE_PARAMETER)); time += 2000; - assertEqualsM("#3", 60.6, is.getIdle(1050, time PASS_ENGINE_PARAMETER)); + assertEqualsM("idke#3", 60.0, is.getIdle(1050, time PASS_ENGINE_PARAMETER)); } void testPidController(void) { diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index cacd93b308..f4eefb0f58 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -254,10 +254,10 @@ void testStartupFuelPumping(void) { mockTps = TPS_TS_CONVERSION * 3; sf.update(PASS_ENGINE_PARAMETER_F); - assertEqualsM("pc#2", 1, sf.pumpsCounter); + assertEqualsM("pumpsCounter#2", 2, sf.pumpsCounter); sf.update(PASS_ENGINE_PARAMETER_F); - assertEqualsM("pc#3", 1, sf.pumpsCounter); + assertEqualsM("pc#3", 3, sf.pumpsCounter); engine->rpmCalculator.mockRpm = 10; sf.update(PASS_ENGINE_PARAMETER_F); @@ -270,11 +270,11 @@ void testStartupFuelPumping(void) { mockTps = TPS_TS_CONVERSION * 3; sf.update(PASS_ENGINE_PARAMETER_F); - assertEqualsM("pc#6", 1, sf.pumpsCounter); + assertEqualsM("pc#6", 2, sf.pumpsCounter); mockTps = TPS_TS_CONVERSION * 7; sf.update(PASS_ENGINE_PARAMETER_F); - assertEqualsM("pc#7", 2, sf.pumpsCounter); + assertEqualsM("pc#7", 3, sf.pumpsCounter); } static void assertREquals(void *expected, void *actual) { @@ -902,7 +902,7 @@ void testFuelSchedulerBug299smallAndMedium(void) { timeNow += MS2US(20); assertEqualsM("executed #06", 4, schedulingQueue.executeAll(timeNow)); assertEqualsM("qs#06", 1, schedulingQueue.size()); - assertInjectors("#2", 1, 0); + assertInjectors("inj#2", 1, 0); eth.firePrimaryTriggerRise(); assertEqualsM("Queue.size#03", 5, schedulingQueue.size()); @@ -1231,7 +1231,7 @@ void testMissedSpark299(void) { engineConfiguration->isIgnitionEnabled = true; engineConfiguration->isInjectionEnabled = false; - assertEqualsM("warningCounter#0", 2, warningCounter); + assertEqualsM("warningCounter#0", 4, warningCounter); timeNow += MS2US(20); eth.firePrimaryTriggerRise(); @@ -1302,5 +1302,5 @@ void testMissedSpark299(void) { eth.firePrimaryTriggerFall(); schedulingQueue.executeAll(timeNow); - assertEqualsM("warningCounter#1", 3, warningCounter); + assertEqualsM("warningCounter#1", 5, warningCounter); }