diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index 9c966ec712..023043f124 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -18,16 +18,6 @@ #define MOCK_UNDEFINED -1 -typedef struct { - float baseCrankingFuel; - - /** - * This value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm') - * Anything above 'crankingRpm' would be 'running' - */ - int16_t crankingRpm; -} cranking_parameters_s; - #define INJECTION_PIN_COUNT 12 #define IGNITION_PIN_COUNT 12 @@ -382,12 +372,15 @@ typedef struct { */ int engineCycle; + /** + * offset 348 + */ cranking_parameters_s crankingSettings; - /** * @see hasMapSensor * @see isMapAveragingEnabled - */ + * offset 356 + */ MAP_sensor_config_s map; // todo: merge with channel settings, use full-scale Thermistor here! diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h new file mode 100644 index 0000000000..9957bd80cb --- /dev/null +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -0,0 +1,67 @@ +typedef struct { + /** + * offset 0 + */ + float baseCrankingFuel; + /** + * This value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm') + * Anything above 'crankingRpm' would be 'running' + * offset 4 + */ + int16_t crankingRpm; + /** + * need 4 byte alignment + * offset 6 + */ + uint8_t alignmentFill[2]; + /** total size 8*/ +} cranking_parameters_s; + +/** + * @brief Thermistor curve parameters + + */ +typedef struct { + /** + * these values are in Celcuus + * offset 0 + */ + float tempC_1; + /** + * offset 4 + */ + float tempC_2; + /** + * offset 8 + */ + float tempC_3; + /** + * offset 12 + */ + float resistance_1; + /** + * offset 16 + */ + float resistance_2; + /** + * offset 20 + */ + float resistance_3; + /** + * offset 24 + */ + float bias_resistor; + /** + * offset 28 + */ + float s_h_a; + /** + * offset 32 + */ + float s_h_b; + /** + * offset 36 + */ + float s_h_c; + /** total size 40*/ +} ThermistorConf; diff --git a/firmware/controllers/sensors/sensor_types.h b/firmware/controllers/sensors/sensor_types.h index ed7b784826..b4447b7aa4 100644 --- a/firmware/controllers/sensors/sensor_types.h +++ b/firmware/controllers/sensors/sensor_types.h @@ -12,6 +12,7 @@ #define MAP_WINDOW_SIZE 8 #include "rusefi_enums.h" +#include "engine_configuration_generated_structures.h" typedef struct { /** @@ -47,25 +48,6 @@ typedef struct { } MAP_sensor_config_s; -/** - * @brief Thermistor curve parameters - */ -typedef struct { - // these values is in Celcuus - float tempC_1; - float tempC_2; - float tempC_3; - float resistance_1; - float resistance_2; - float resistance_3; - - float bias_resistor; - - float s_h_a; - float s_h_b; - float s_h_c; -} ThermistorConf; - typedef struct { ThermistorConf *config; adc_channel_e channel; diff --git a/firmware/rusefi_config.ini b/firmware/rusefi_config.ini index 4fc1aef9bd..a0c7be4ac3 100644 --- a/firmware/rusefi_config.ini +++ b/firmware/rusefi_config.ini @@ -9,12 +9,47 @@ struct cranking_parameters_s +float;baseCrankingFuel; +int16_t;crankingRpm;This value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm')\nAnything above 'crankingRpm' would be 'running' +end_struct + + +struct air_pressure_sensor_config_s + float;customValueAt0;kPa value at zero volts +float;customValueAt5;kPa value at 5 volts +air_pressure_sensor_type_e;sensorType; +adc_channel_e;hwChannel +end_struct + + +#define MAP_ANGLE_SIZE 8 +#define MAP_WINDOW_SIZE 8 + +struct MAP_sensor_config_s +array float MAP_ANGLE_SIZE;samplingAngleBins +array float MAP_ANGLE_SIZE;samplingAngle;@brief MAP averaging sampling start angle, by RPM +end_struct + +struct ThermistorConf @brief Thermistor curve parameters +float;tempC_1;these values are in Celcuus +float;tempC_2 +float;tempC_3 +float;resistance_1 +float;resistance_2 +float;resistance_3 + + float;bias_resistor; + + float;s_h_a; + float;s_h_b; + float;s_h_c; + end_struct - +struct engine_configuration_s @@ -49,4 +84,10 @@ int16_t;tpsErrorLowValue;todo: finish implementation. These values are used for int16_t;tpsErrorHighValue float;primingSquirtDurationMs -int;engineCycle;360 for two-stroke\n720 for four-stroke \ No newline at end of file +int;engineCycle;360 for two-stroke\n720 for four-stroke + +cranking_parameters_s;crankingSettings +MAP_sensor_config_s;map;@see hasMapSensor\n@see isMapAveragingEnabled + + +end_struct \ No newline at end of file