diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 4248a1f900..da6e137c03 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -284,6 +284,7 @@ void prepareVoidConfiguration(engine_configuration_s *activeConfiguration) { engineConfiguration->auxValves[i] = GPIO_UNASSIGNED; } engineConfiguration->LIS302DLCsPin = GPIO_UNASSIGNED; + engineConfiguration->flexFuelSensor = GPIO_UNASSIGNED; boardConfiguration->joystickCenterPin = GPIO_UNASSIGNED; boardConfiguration->joystickAPin = GPIO_UNASSIGNED; diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index cdd6ebecfe..2242a8a131 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 Sun Jan 21 12:13:41 EST 2018 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Jan 22 23:24:40 EST 2018 // begin #ifndef ENGINE_CONFIGURATION_GENERATED_H_ #define ENGINE_CONFIGURATION_GENERATED_H_ @@ -2075,7 +2075,11 @@ typedef struct { /** * offset 3304 */ - int unusedEnd[794]; + brain_input_pin_e flexFuelSensor; + /** + * offset 3308 + */ + int unusedEnd[793]; /** total size 6480*/ } engine_configuration_s; @@ -2321,4 +2325,4 @@ typedef struct { #endif // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jan 21 12:13:41 EST 2018 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Jan 22 23:24:40 EST 2018 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 6c7a96e49b..252b3cb67c 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -1526,8 +1526,10 @@ #define fsioCurve4Bins_offset_hex ca8 #define fsioCurve4_offset 3272 #define fsioCurve4_offset_hex cc8 -#define unusedEnd_offset 3304 -#define unusedEnd_offset_hex ce8 +#define flexFuelSensor_offset 3304 +#define flexFuelSensor_offset_hex ce8 +#define unusedEnd_offset 3308 +#define unusedEnd_offset_hex cec #define cltCrankingCorrBins_offset 6480 #define cltCrankingCorrBins_offset_hex 1950 #define cltCrankingCorr_offset 6512 diff --git a/firmware/controllers/sensors/allsensors.cpp b/firmware/controllers/sensors/allsensors.cpp index 1e12cf9bc0..6cf07abadc 100644 --- a/firmware/controllers/sensors/allsensors.cpp +++ b/firmware/controllers/sensors/allsensors.cpp @@ -15,6 +15,7 @@ EXTERN_ENGINE; void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { initThermistors(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); initMapDecoder(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); + initFlexFuelSensor(); } // todo: move this somewhere else? maybe. diff --git a/firmware/controllers/sensors/allsensors.h b/firmware/controllers/sensors/allsensors.h index 44afc3e74b..cf601082ac 100644 --- a/firmware/controllers/sensors/allsensors.h +++ b/firmware/controllers/sensors/allsensors.h @@ -20,6 +20,7 @@ #include "voltage.h" #include "thermistors.h" #include "oil_pressure.h" +#include "flex_fuel.h" #include "adc_inputs.h" #include "analog_input.h" diff --git a/firmware/controllers/sensors/flex_fuel.cpp b/firmware/controllers/sensors/flex_fuel.cpp new file mode 100644 index 0000000000..7274fc7618 --- /dev/null +++ b/firmware/controllers/sensors/flex_fuel.cpp @@ -0,0 +1,26 @@ +/* + * @file flex_fuel.cpp + * + * GM 12568450 + * GM 12570260 + * GM 13577394 + * GM 13577429 + * + * @author Andrey Belomutskiy, (c) 2012-2018 + * @date Jan 22, 2018 + */ + +#ifndef CONTROLLERS_SENSORS_FLEX_FUEL_CPP_ +#define CONTROLLERS_SENSORS_FLEX_FUEL_CPP_ + +#include "engine.h" + +EXTERN_ENGINE +; + +void initFlexFuelSensor() { + +} + + +#endif /* CONTROLLERS_SENSORS_FLEX_FUEL_CPP_ */ diff --git a/firmware/controllers/sensors/flex_fuel.h b/firmware/controllers/sensors/flex_fuel.h new file mode 100644 index 0000000000..1b860b25e4 --- /dev/null +++ b/firmware/controllers/sensors/flex_fuel.h @@ -0,0 +1,13 @@ +/* + * @file flex_fuel.h + * + * @author Andrey Belomutskiy, (c) 2012-2018 + * @date Jan 22, 2018 + */ + +#ifndef CONTROLLERS_SENSORS_FLEX_FUEL_H_ +#define CONTROLLERS_SENSORS_FLEX_FUEL_H_ + +void initFlexFuelSensor(); + +#endif /* CONTROLLERS_SENSORS_FLEX_FUEL_H_ */ diff --git a/firmware/controllers/sensors/sensors.mk b/firmware/controllers/sensors/sensors.mk index f7b9e7b5be..dc905b7cd4 100644 --- a/firmware/controllers/sensors/sensors.mk +++ b/firmware/controllers/sensors/sensors.mk @@ -9,4 +9,5 @@ CONTROLLERS_SENSORS_SRC_CPP = $(PROJECT_DIR)/controllers/sensors/thermistors.cp $(PROJECT_DIR)/controllers/sensors/tps.cpp \ $(PROJECT_DIR)/controllers/sensors/ego.cpp \ $(PROJECT_DIR)/controllers/sensors/hip9011_lookup.cpp \ + $(PROJECT_DIR)/controllers/sensors/flex_fuel.cpp \ $(PROJECT_DIR)/controllers/sensors/oil_pressure.cpp diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 94363bb6f7..5d3bb48c81 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -886,7 +886,8 @@ spi_device_e accelerometerSpiDevice; float[FSIO_CURVE_8] fsioCurve3;;"y", 1, 0, -999, 1000.0, 3 float[FSIO_CURVE_8] fsioCurve4Bins;;"x", 1, 0, -999, 1000.0, 3 float[FSIO_CURVE_8] fsioCurve4;;"y", 1, 0, -999, 1000.0, 3 - int[794] unusedEnd; +brain_input_pin_e flexFuelSensor; + int[793] unusedEnd; end_struct diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 55d568cb1c..ddd4602519 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -263,5 +263,5 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20180121; + return 20180122; } diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index a154357631..7f65092cce 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1707,6 +1707,7 @@ cmd_stop_engine = "w\x00\x99\x00\x00" field = "!todo: move MAF channel to maf curve dialog" field = "MAF ADC input", mafAdcChannel field = "Baro ADC input", baroSensor_hwChannel + field = "Flex Fuel", flexFuelSensor field = "Use fixed baro corr from MAP", useFixedBaroCorrFromMap field = "Analog divider", analogInputDividerCoefficient field = "Use BiQuad averaging", useBiQuadAnalogFiltering diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 76077adf00..9fba814da2 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 Sun Jan 21 12:13:41 EST 2018 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Jan 22 23:24:40 EST 2018 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int BLOCKING_FACTOR = 400; @@ -1014,7 +1014,8 @@ public class Fields { public static final int fsioCurve3_offset = 3208; public static final int fsioCurve4Bins_offset = 3240; public static final int fsioCurve4_offset = 3272; - public static final int unusedEnd_offset = 3304; + public static final int flexFuelSensor_offset = 3304; + public static final int unusedEnd_offset = 3308; public static final int cltCrankingCorrBins_offset = 6480; public static final int cltCrankingCorrBins_offset_hex = 1950; public static final int cltCrankingCorr_offset = 6512; @@ -1828,6 +1829,7 @@ public class Fields { public static final Field OILPRESSURE_V2 = Field.create("OILPRESSURE_V2", 2908, FieldType.FLOAT); public static final Field OILPRESSURE_VALUE2 = Field.create("OILPRESSURE_VALUE2", 2912, FieldType.FLOAT); public static final Field ACCELEROMETERSPIDEVICE = Field.create("ACCELEROMETERSPIDEVICE", 2916, FieldType.INT); + public static final Field FLEXFUELSENSOR = Field.create("FLEXFUELSENSOR", 3304, FieldType.INT, brain_input_pin_e); public static final Field FSIOFORMULAS1 = Field.create("FSIOFORMULAS1", 6672, FieldType.INT); public static final Field FSIOFORMULAS2 = Field.create("FSIOFORMULAS2", 6872, FieldType.INT); public static final Field FSIOFORMULAS3 = Field.create("FSIOFORMULAS3", 7072, FieldType.INT);