diff --git a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp index b643092249..d975c5a789 100644 --- a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp +++ b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp @@ -7,6 +7,7 @@ #include "expected.h" #include "sensor.h" #include "map.h" +#include "engine_math.h" EXTERN_ENGINE; @@ -27,6 +28,10 @@ expected readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETE return Sensor::get(SensorType::Clt); case GPPWM_Iat: return Sensor::get(SensorType::Iat); + case GPPWM_FuelLoad: + return getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); + case GPPWM_IgnLoad: + return getIgnitionLoad(PASS_ENGINE_PARAMETER_SIGNATURE); default: return unexpected; } diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index 0b31355cb7..3290b2a344 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -916,6 +916,10 @@ case GPPWM_Map: return "GPPWM_Map"; case GPPWM_Tps: return "GPPWM_Tps"; +case GPPWM_FuelLoad: + return "GPPWM_FuelLoad"; +case GPPWM_IgnLoad: + return "GPPWM_IgnLoad"; } return NULL; } diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index ed4f81e8d2..891a0fb55f 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -952,6 +952,8 @@ typedef enum __attribute__ ((__packed__)) { GPPWM_Map = 1, GPPWM_Clt = 2, GPPWM_Iat = 3, + GPPWM_FuelLoad = 4, + GPPWM_IgnLoad = 5, } gppwm_channel_e; typedef enum __attribute__ ((__packed__)) { diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index c443ec0b74..eeae813e95 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -289,8 +289,8 @@ struct spi_pins end_struct -#define gppwm_channel_e_enum "TPS", "MAP", "CLT", "IAT" -custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:1], @@gppwm_channel_e_enum@@ +#define gppwm_channel_e_enum "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "INVALID", "INVALID" +custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:2], @@gppwm_channel_e_enum@@ struct gppwm_channel output_pin_e pin;+Select a pin to use for PWM or on-off output.; diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 2bcc8400ac..dc6be42fb4 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -363,10 +363,10 @@ enable2ndByteCanID = false time = { timeNow } ; These "synthetic" channels provide the Y-axis (load) value for gen purp PWM table's Y axes - gppwm1_load = {(gppwm1_loadAxis == 0) ? TPSValue : ((gppwm1_loadAxis == 1) ? MAPValue : ((gppwm1_loadAxis == 2) ? coolant : intake))} - gppwm2_load = {(gppwm2_loadAxis == 0) ? TPSValue : ((gppwm2_loadAxis == 1) ? MAPValue : ((gppwm2_loadAxis == 2) ? coolant : intake))} - gppwm3_load = {(gppwm3_loadAxis == 0) ? TPSValue : ((gppwm3_loadAxis == 1) ? MAPValue : ((gppwm3_loadAxis == 2) ? coolant : intake))} - gppwm4_load = {(gppwm4_loadAxis == 0) ? TPSValue : ((gppwm4_loadAxis == 1) ? MAPValue : ((gppwm4_loadAxis == 2) ? coolant : intake))} + gppwm1_load = {(gppwm1_loadAxis == 0) ? TPSValue : ((gppwm1_loadAxis == 1) ? MAPValue : ((gppwm1_loadAxis == 2) ? coolant : ((gppwm1_loadAxis == 3) ? intake : ((gppwm1_loadAxis == 4) ? fuelingLoad : ignitionLoad))))} + gppwm2_load = {(gppwm2_loadAxis == 0) ? TPSValue : ((gppwm2_loadAxis == 1) ? MAPValue : ((gppwm2_loadAxis == 2) ? coolant : ((gppwm2_loadAxis == 3) ? intake : ((gppwm2_loadAxis == 4) ? fuelingLoad : ignitionLoad))))} + gppwm3_load = {(gppwm3_loadAxis == 0) ? TPSValue : ((gppwm3_loadAxis == 1) ? MAPValue : ((gppwm3_loadAxis == 2) ? coolant : ((gppwm3_loadAxis == 3) ? intake : ((gppwm3_loadAxis == 4) ? fuelingLoad : ignitionLoad))))} + gppwm4_load = {(gppwm4_loadAxis == 0) ? TPSValue : ((gppwm4_loadAxis == 1) ? MAPValue : ((gppwm4_loadAxis == 2) ? coolant : ((gppwm4_loadAxis == 3) ? intake : ((gppwm4_loadAxis == 4) ? fuelingLoad : ignitionLoad))))} [PcVariables] tuneCrcPcVariable = continuousChannelValue, tuneCrc16