Flex fuel stubs (#2187)
* config & ui * stub sensor * stub init * output channel, gauge, SD log * linky linky * fix Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
07abef8473
commit
edee10ee1c
|
@ -244,7 +244,7 @@ typedef struct {
|
|||
int8_t knockLevels[12]; // 250
|
||||
|
||||
int8_t tcuDesiredGear; // 262
|
||||
int8_t padding2[1]; // 263
|
||||
scaled_channel<uint8_t, 2> flexPercent; // 263
|
||||
|
||||
scaled_voltage rawIdlePositionSensor; // 264
|
||||
scaled_voltage rawWastegatePositionSensor; // 266
|
||||
|
|
|
@ -63,6 +63,7 @@ static const LogField fields[] = {
|
|||
{tsOutputChannels.fuelingLoad, GAUGE_NAME_FUEL_LOAD, "%", 1},
|
||||
{tsOutputChannels.ignitionLoad, GAUGE_NAME_IGNITION_LOAD, "%", 1},
|
||||
{tsOutputChannels.massAirFlow, GAUGE_NAME_AIR_FLOW, "kg/h", 1},
|
||||
{tsOutputChannels.flexPercent, GAUGE_NAME_FLEX, "%", 1},
|
||||
};
|
||||
|
||||
void writeHeader(Writer& outBuffer) {
|
||||
|
|
|
@ -603,6 +603,8 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
// High pressure is in bar, aka 100 kpa
|
||||
tsOutputChannels->highFuelPressure = KPA2BAR(Sensor::get(SensorType::FuelPressureHigh).Value);
|
||||
|
||||
tsOutputChannels->flexPercent = Sensor::get(SensorType::FuelEthanolPercent).Value;
|
||||
|
||||
// 288
|
||||
tsOutputChannels->injectionOffset = engine->engineState.injectionOffset;
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@ static const char* s_sensorNames[] = {
|
|||
|
||||
"Wastegate Position",
|
||||
"Idle Valve Position",
|
||||
|
||||
"Flex Fuel",
|
||||
};
|
||||
|
||||
// This struct represents one sensor in the registry.
|
||||
|
|
|
@ -58,6 +58,8 @@ enum class SensorType : unsigned char {
|
|||
WastegatePosition,
|
||||
IdlePosition,
|
||||
|
||||
FuelEthanolPercent,
|
||||
|
||||
// Leave me at the end!
|
||||
PlaceholderLast
|
||||
};
|
||||
|
|
|
@ -25,6 +25,7 @@ void initOilPressure(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
|||
void initThermistors(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
void initCanSensors();
|
||||
void initLambda(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void initFlexSensor(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
||||
// Sensor reconfiguration
|
||||
void reconfigureTps(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
|
|
@ -6,3 +6,4 @@ INIT_SRC_CPP = $(PROJECT_DIR)/init/sensor/init_sensors.cpp \
|
|||
$(PROJECT_DIR)/init/sensor/init_thermistors.cpp \
|
||||
$(PROJECT_DIR)/init/sensor/init_lambda.cpp \
|
||||
$(PROJECT_DIR)/init/sensor/init_map.cpp \
|
||||
$(PROJECT_DIR)/init/sensor/init_flex.cpp \
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
#include "init.h"
|
||||
#include "engine.h"
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
// https://rusefi.com/forum/viewtopic.php?p=37452&sid=829804c90d5b2e1fecd1b900cf1b1811#p37452
|
||||
|
||||
void initFlexSensor(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||
auto pin = CONFIG(flexSensorPin);
|
||||
|
||||
// Nothing to do if no sensor configured
|
||||
if (pin == GPIO_UNASSIGNED) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: init sensor
|
||||
}
|
|
@ -18,6 +18,7 @@ void initNewSensors(Logging* logger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|||
initOilPressure(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
initThermistors(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
initLambda(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
initFlexSensor(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
||||
// Init CLI functionality for sensors (mocking)
|
||||
initSensorCli(logger);
|
||||
|
|
|
@ -1358,7 +1358,7 @@ tle8888_mode_e tle8888mode;
|
|||
float[FSIO_CURVE_8] fsioCurve4Bins;;"x", 1, 0, -999, 1000.0, 3
|
||||
float[FSIO_CURVE_8] fsioCurve4;;"y", 1, 0, -999, 1000.0, 3
|
||||
|
||||
uint8_t unusedFlexFuelSensor;For pinout see https://rusefi.com/forum/viewtopic.php?f=5&t=1324;"units", 1, 0, -20, 100, 0
|
||||
brain_input_pin_e flexSensorPin;+Continental/GM flex fuel sensor, 50-150hz type
|
||||
brain_pin_e test557pin
|
||||
pin_output_mode_e stepperDirectionPinMode;
|
||||
adc_channel_e externalKnockSenseAdc;
|
||||
|
@ -1633,6 +1633,7 @@ end_struct
|
|||
#define GAUGE_NAME_RAW_FUEL_PRESSURE_HIGH "Fuel pressure raw (high)"
|
||||
#define GAUGE_NAME_FUEL_PRESSURE_HIGH "Fuel pressure (high)"
|
||||
#define GAUGE_NAME_FUEL_PRESSURE_HIGH_UNITS "bar"
|
||||
#define GAUGE_NAME_FLEX "Flex Ethanol %"
|
||||
|
||||
#define GAUGE_NAME_ACCEL_X "Acceleration: X"
|
||||
#define GAUGE_NAME_ACCEL_Y "Acceleration: Y"
|
||||
|
|
|
@ -378,6 +378,8 @@ enable2ndByteCanID = false
|
|||
knock7 = scalar, S08, 256, "dbv", 1, 0
|
||||
knock8 = scalar, S08, 257, "dbv", 1, 0
|
||||
|
||||
flexPercent = scalar, U08, 263, "%", 0.5, 0
|
||||
|
||||
rawIdlePositionSensor = scalar, U16, 264, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
|
||||
rawWastegatePosition = scalar, U16, 266, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
|
||||
wastegatePositionSensor = scalar, S16, 268, "%",{1/@@PACK_MULT_PERCENT@@}, 0
|
||||
|
@ -1003,6 +1005,7 @@ gaugeCategory = Sensors - Extra 1
|
|||
AuxT2Gauge = auxt2, "Aux temp 2", "deg C", -40, 140, -15, 1, 95, 110, 1, 1
|
||||
lowFuelPressureGauge = lowFuelPressure, @@GAUGE_NAME_FUEL_PRESSURE_LOW@@, @@GAUGE_NAME_FUEL_PRESSURE_LOW_UNITS@@, 0, 700, 0, 0, 700, 700, 1, 0
|
||||
highFuelPressureGauge = highFuelPressure, @@GAUGE_NAME_FUEL_PRESSURE_HIGH@@, @@GAUGE_NAME_FUEL_PRESSURE_HIGH_UNITS@@, 0, 200, 0, 0, 200, 200, 1, 0
|
||||
flexPercentGauge = flexPercent, @@GAUGE_NAME_FLEX@@, "%", 0, 100, 0, 0, 100, 100, 0, 0
|
||||
|
||||
gaugeCategory = Ignition
|
||||
ignadvGauge = ignitionAdvance, "Ignition timing", "degrees", -100, 100, -999, -999, 999, 999, 1, 1
|
||||
|
@ -1313,13 +1316,7 @@ gaugeCategory = DynoView
|
|||
|
||||
entry = VssAcceleration, "Accel", float, "%.3f"
|
||||
|
||||
; tpsADC = U16, "ADC",
|
||||
; alignmet = U16, "al",
|
||||
; atmPres = F32, "pres",
|
||||
; crankingFuel = F32, "ms",
|
||||
; tCharge = F32, "T",
|
||||
; sparkDwell = F32, "MAP",
|
||||
; warmUpEnrich = F32, "%",
|
||||
entry = flexPercent, @@GAUGE_NAME_FLEX@@, int, "%d"
|
||||
|
||||
[Menu]
|
||||
|
||||
|
@ -2066,6 +2063,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
|
|||
field = "Brake pedal switch", brakePedalPin
|
||||
field = "A/C switch", acSwitch
|
||||
field = "A/C switch mode", acSwitchMode
|
||||
field = "Flex fuel sensor", flexSensorPin
|
||||
|
||||
dialog = triggerInputComparator, "Built-in Comparator Settings (Kinetis-only)"
|
||||
field = "Comparator Center Point Voltage", triggerCompCenterVolt
|
||||
|
|
Loading…
Reference in New Issue