diff --git a/firmware/console/binary/output_channels.txt b/firmware/console/binary/output_channels.txt index 6891f765dc..2b58735da2 100644 --- a/firmware/console/binary/output_channels.txt +++ b/firmware/console/binary/output_channels.txt @@ -249,6 +249,8 @@ int16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2 float auxLinear1;@@GAUGE_NAME_AUX_LINEAR_1@@;"", 1, 0, 0, 0, 2 float auxLinear2;@@GAUGE_NAME_AUX_LINEAR_2@@;"", 1, 0, 0, 0, 2 + float auxLinear3;@@GAUGE_NAME_AUX_LINEAR_3@@;"", 1, 0, 0, 0, 2 + float auxLinear4;@@GAUGE_NAME_AUX_LINEAR_4@@;"", 1, 0, 0, 0, 2 uint16_t autoscale fallbackMap;;"kPa", 0.1, 0, 0, 1000, 1 diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index c19895f2aa..900adfa5c7 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -387,6 +387,8 @@ static void updatePressures() { engine->outputChannels.auxLinear1 = Sensor::getOrZero(SensorType::AuxLinear1); engine->outputChannels.auxLinear2 = Sensor::getOrZero(SensorType::AuxLinear2); + engine->outputChannels.auxLinear3 = Sensor::getOrZero(SensorType::AuxLinear3); + engine->outputChannels.auxLinear4 = Sensor::getOrZero(SensorType::AuxLinear4); } static void updateMiscSensors() { diff --git a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp index abd793710c..92c3299ba9 100644 --- a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp +++ b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp @@ -58,6 +58,10 @@ expected readGppwmChannel(gppwm_channel_e channel) { return Sensor::get(SensorType::AuxLinear1); case GPPWM_AuxLinear2: return Sensor::get(SensorType::AuxLinear2); + case GPPWM_AuxLinear3: + return Sensor::get(SensorType::AuxLinear3); + case GPPWM_AuxLinear4: + return Sensor::get(SensorType::AuxLinear4); case GPPWM_GppwmOutput1: return (float)engine->outputChannels.gppwmOutput[0]; case GPPWM_GppwmOutput2: diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index a0b704ebf1..ef5ed9501f 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -527,6 +527,8 @@ typedef enum __attribute__ ((__packed__)) { GPPWM_BaroPressure = 26, GPPWM_Egt1 = 27, GPPWM_Egt2 = 28, + GPPWM_AuxLinear3 = 29, + GPPWM_AuxLinear4 = 30, } gppwm_channel_e; typedef enum __attribute__ ((__packed__)) { diff --git a/firmware/controllers/sensors/sensor_type.h b/firmware/controllers/sensors/sensor_type.h index a2904c5e8a..3e70ed6690 100644 --- a/firmware/controllers/sensors/sensor_type.h +++ b/firmware/controllers/sensors/sensor_type.h @@ -118,6 +118,8 @@ enum class SensorType : unsigned char { AuxLinear1, AuxLinear2, + AuxLinear3, + AuxLinear4, // frequency sensors AuxSpeed1, diff --git a/firmware/init/sensor/init_fluid_pressure.cpp b/firmware/init/sensor/init_fluid_pressure.cpp index 0e62ee0405..c993e506c3 100644 --- a/firmware/init/sensor/init_fluid_pressure.cpp +++ b/firmware/init/sensor/init_fluid_pressure.cpp @@ -23,6 +23,12 @@ static FunctionalSensor auxLinear1Sensor(SensorType::AuxLinear1, /* timeout = */ static LinearFunc auxLinear2Func; static FunctionalSensor auxLinear2Sensor(SensorType::AuxLinear2, /* timeout = */ MS2NT(50)); +static LinearFunc auxLinear3Func; +static FunctionalSensor auxLinear3Sensor(SensorType::AuxLinear3, /* timeout = */ MS2NT(50)); + +static LinearFunc auxLinear4Func; +static FunctionalSensor auxLinear4Sensor(SensorType::AuxLinear4, /* timeout = */ MS2NT(50)); + /** * @param bandwidth Hertz, used by low pass filter in to analog subscribers */ @@ -57,6 +63,8 @@ void initFluidPressure() { initFluidPressure(fuelPressureFuncHigh, fuelPressureSensorHigh, engineConfiguration->highPressureFuel, 100); initFluidPressure(auxLinear1Func, auxLinear1Sensor, engineConfiguration->auxLinear1, 10); initFluidPressure(auxLinear2Func, auxLinear2Sensor, engineConfiguration->auxLinear2, 10); + initFluidPressure(auxLinear3Func, auxLinear3Sensor, engineConfiguration->auxLinear3, 10); + initFluidPressure(auxLinear4Func, auxLinear4Sensor, engineConfiguration->auxLinear4, 10); injectorPressure.setProxiedSensor( engineConfiguration->injectorPressureType == IPT_High @@ -73,4 +81,6 @@ void deinitFluidPressure() { AdcSubscription::UnsubscribeSensor(fuelPressureSensorHigh, engineConfiguration->highPressureFuel.hwChannel); AdcSubscription::UnsubscribeSensor(auxLinear1Sensor, engineConfiguration->auxLinear1.hwChannel); AdcSubscription::UnsubscribeSensor(auxLinear2Sensor, engineConfiguration->auxLinear2.hwChannel); + AdcSubscription::UnsubscribeSensor(auxLinear3Sensor, engineConfiguration->auxLinear3.hwChannel); + AdcSubscription::UnsubscribeSensor(auxLinear4Sensor, engineConfiguration->auxLinear4.hwChannel); } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 31a84471d3..72cb874972 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -302,7 +302,7 @@ custom pin_output_mode_e 1 bits, U08, @OFFSET@, [0:1], @@pin_output_mode_e_enum@ #define pin_input_mode_e_enum "DEFAULT", "PULLUP", "PULLDOWN" custom pin_input_mode_e 1 bits, U08, @OFFSET@, [0:1], @@pin_input_mode_e_enum@@ -#define gppwm_channel_e_enum "Zero", "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "Aux Temp 1", "Aux Temp 2", "Accel Pedal", "Battery Voltage", "VVT 1 I", "VVT 1 E", "VVT 2 I", "VVT 2 E", "Ethanol (Flex) %", "Aux Linear 1", "Aux Linear 2", "GPPWM Output 1", "GPPWM Output 2", "GPPWM Output 3", "GPPWM Output 4", "Lua Gauge 1", "Lua Gauge 2", "RPM", "Gear (detected)", "Baro pressure", "EGT 1", "EGT 2" +#define gppwm_channel_e_enum "Zero", "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "Aux Temp 1", "Aux Temp 2", "Accel Pedal", "Battery Voltage", "VVT 1 I", "VVT 1 E", "VVT 2 I", "VVT 2 E", "Ethanol (Flex) %", "Aux Linear 1", "Aux Linear 2", "GPPWM Output 1", "GPPWM Output 2", "GPPWM Output 3", "GPPWM Output 4", "Lua Gauge 1", "Lua Gauge 2", "RPM", "Gear (detected)", "Baro pressure", "EGT 1", "EGT 2", "Aux Linear 3", "Aux Linear 4" custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:4], @@gppwm_channel_e_enum@@ struct gppwm_channel @@ -1364,6 +1364,8 @@ uint16_t vvtActivationDelayMs;We need to give engine time to build oil pressure linear_sensor_s auxLinear1 linear_sensor_s auxLinear2 +linear_sensor_s auxLinear3 +linear_sensor_s auxLinear4 output_pin_e tcu_tcc_onoff_solenoid pin_output_mode_e tcu_tcc_onoff_solenoid_mode diff --git a/firmware/integration/rusefi_config_shared.txt b/firmware/integration/rusefi_config_shared.txt index 41aad153cd..67f7b70c1c 100644 --- a/firmware/integration/rusefi_config_shared.txt +++ b/firmware/integration/rusefi_config_shared.txt @@ -106,6 +106,8 @@ #define GAUGE_NAME_AUX_LINEAR_1 "Aux linear #1" #define GAUGE_NAME_AUX_LINEAR_2 "Aux linear #2" +#define GAUGE_NAME_AUX_LINEAR_3 "Aux linear #3" +#define GAUGE_NAME_AUX_LINEAR_4 "Aux linear #4" #define GAUGE_NAME_BOOST_OUTPUT "Boost: Output" #define GAUGE_NAME_BOOST_CLOSED_LOOP "Boost: Closed loop" diff --git a/firmware/tunerstudio/tunerstudio.template.ini b/firmware/tunerstudio/tunerstudio.template.ini index 61750938c5..9164b3bfae 100644 --- a/firmware/tunerstudio/tunerstudio.template.ini +++ b/firmware/tunerstudio/tunerstudio.template.ini @@ -1392,6 +1392,8 @@ gaugeCategory = Sensors - Extra 1 fuelTankLevelGauge = fuelTankLevel,"Fuel level", "%", 0, 100, 10, 20, 100, 100, 1, 1 AuxL1Gauge = auxLinear1, @@GAUGE_NAME_AUX_LINEAR_1@@, "", -100, 100, -100, -100, 100, 100, 2, 2 AuxL2Gauge = auxLinear2, @@GAUGE_NAME_AUX_LINEAR_2@@, "", -100, 100, -100, -100, 100, 100, 2, 2 + AuxL3Gauge = auxLinear3, @@GAUGE_NAME_AUX_LINEAR_3@@, "", -100, 100, -100, -100, 100, 100, 2, 2 + AuxL4Gauge = auxLinear4, @@GAUGE_NAME_AUX_LINEAR_4@@, "", -100, 100, -100, -100, 100, 100, 2, 2 gaugeCategory = Sensors - Extra 2 accelerationLatGauge = accelerationLat, @@GAUGE_NAME_ACCEL_LAT@@, "acc", -2, 2, -2, -1, 1, 2, 3, 1 @@ -3140,9 +3142,25 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_ field = "High voltage", auxLinear2_v2, {auxLinear2_hwChannel != @@ADC_CHANNEL_NONE@@} field = "High value", auxLinear2_value2, {auxLinear2_hwChannel != @@ADC_CHANNEL_NONE@@} + dialog = auxLinearSensor3, "Aux Linear Sensor #3" + field = "ADC input", auxLinear3_hwChannel + field = "Low voltage", auxLinear3_v1, {auxLinear3_hwChannel != @@ADC_CHANNEL_NONE@@} + field = "Low value", auxLinear3_value1, {auxLinear3_hwChannel != @@ADC_CHANNEL_NONE@@} + field = "High voltage", auxLinear3_v2, {auxLinear3_hwChannel != @@ADC_CHANNEL_NONE@@} + field = "High value", auxLinear3_value2, {auxLinear3_hwChannel != @@ADC_CHANNEL_NONE@@} + + dialog = auxLinearSensor4, "Aux Linear Sensor #4" + field = "ADC input", auxLinear4_hwChannel + field = "Low voltage", auxLinear4_v1, {auxLinear4_hwChannel != @@ADC_CHANNEL_NONE@@} + field = "Low value", auxLinear4_value1, {auxLinear4_hwChannel != @@ADC_CHANNEL_NONE@@} + field = "High voltage", auxLinear4_v2, {auxLinear4_hwChannel != @@ADC_CHANNEL_NONE@@} + field = "High value", auxLinear4_value2, {auxLinear4_hwChannel != @@ADC_CHANNEL_NONE@@} + dialog = auxLinearSensors panel = auxLinearSensor1 panel = auxLinearSensor2 + panel = auxLinearSensor3 + panel = auxLinearSensor4 field = auxSpeedSensorInputPin1, auxSpeedSensorInputPin1 field = auxSpeedSensorInputPin2, auxSpeedSensorInputPin2