mirror of https://github.com/rusefi/rusefi-1.git
More gppwm and fsio (#2509)
* gppwm aux temp * fsio fuel flow rate and oil pressure Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
bc1a112f37
commit
f05b8ba675
|
@ -14,9 +14,8 @@ expected<float> readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETE
|
|||
switch (channel) {
|
||||
case GPPWM_Tps:
|
||||
return Sensor::get(SensorType::Tps1);
|
||||
case GPPWM_Map: {
|
||||
case GPPWM_Map:
|
||||
return Sensor::get(SensorType::Map);
|
||||
}
|
||||
case GPPWM_Clt:
|
||||
return Sensor::get(SensorType::Clt);
|
||||
case GPPWM_Iat:
|
||||
|
@ -25,9 +24,13 @@ expected<float> readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETE
|
|||
return getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
case GPPWM_IgnLoad:
|
||||
return getIgnitionLoad(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
default:
|
||||
return unexpected;
|
||||
case GPPWM_AuxTemp1:
|
||||
return Sensor::get(SensorType::AuxTemp1);
|
||||
case GPPWM_AuxTemp2:
|
||||
return Sensor::get(SensorType::AuxTemp2);
|
||||
}
|
||||
|
||||
return unexpected;
|
||||
}
|
||||
|
||||
void GppwmChannel::setOutput(float result) {
|
||||
|
|
|
@ -1009,6 +1009,8 @@ typedef enum __attribute__ ((__packed__)) {
|
|||
GPPWM_Iat = 3,
|
||||
GPPWM_FuelLoad = 4,
|
||||
GPPWM_IgnLoad = 5,
|
||||
GPPWM_AuxTemp1 = 6,
|
||||
GPPWM_AuxTemp2 = 7,
|
||||
} gppwm_channel_e;
|
||||
|
||||
typedef enum __attribute__ ((__packed__)) {
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
#define MAX_TABLE_INDEX 4
|
||||
|
||||
typedef enum {
|
||||
|
||||
LE_UNDEFINED = 0,
|
||||
LE_METHOD_RETURN = 130,
|
||||
|
||||
LE_NUMERIC_VALUE = 1,
|
||||
LE_BOOLEAN_VALUE = 126,
|
||||
LE_OPERATOR_LESS = 2,
|
||||
|
@ -58,7 +59,8 @@ typedef enum {
|
|||
LE_METHOD_PPS = 125,
|
||||
LE_METHOD_TIME_SINCE_TRIGGER_EVENT = 127,
|
||||
LE_METHOD_IN_MR_BENCH = 128,
|
||||
LE_METHOD_RETURN = 130,
|
||||
LE_METHOD_FUEL_FLOW_RATE = 131,
|
||||
LE_METHOD_OIL_PRESSURE = 132,
|
||||
|
||||
#include "fsio_enums_generated.def"
|
||||
|
||||
|
|
|
@ -56,6 +56,8 @@ static LENameOrdinalPair leFan(LE_METHOD_FAN, "fan");
|
|||
static LENameOrdinalPair leCoolant(LE_METHOD_COOLANT, "coolant");
|
||||
static LENameOrdinalPair leIntakeTemp(LE_METHOD_INTAKE_AIR, "iat");
|
||||
static LENameOrdinalPair leIsCoolantBroken(LE_METHOD_IS_COOLANT_BROKEN, "is_clt_broken");
|
||||
static LENameOrdinalPair leOilPressure(LE_METHOD_OIL_PRESSURE, "oilp");
|
||||
|
||||
// @returns boolean state of A/C toggle switch
|
||||
static LENameOrdinalPair leAcToggle(LE_METHOD_AC_TOGGLE, "ac_on_switch");
|
||||
// @returns float number of seconds since last A/C toggle
|
||||
|
@ -73,6 +75,7 @@ static LENameOrdinalPair leStartupFuelPumpDuration(LE_METHOD_STARTUP_FUEL_PUMP_D
|
|||
static LENameOrdinalPair leInShutdown(LE_METHOD_IN_SHUTDOWN, "in_shutdown");
|
||||
static LENameOrdinalPair leInMrBench(LE_METHOD_IN_MR_BENCH, "in_mr_bench");
|
||||
static LENameOrdinalPair leTimeSinceTrigger(LE_METHOD_TIME_SINCE_TRIGGER_EVENT, "time_since_trigger");
|
||||
static LENameOrdinalPair leFuelRate(LE_METHOD_FUEL_FLOW_RATE, "fuel_flow");
|
||||
|
||||
#include "fsio_names.def"
|
||||
|
||||
|
@ -165,6 +168,10 @@ FsioResult getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|||
return Sensor::get(SensorType::BatteryVoltage).value_or(0);
|
||||
case LE_METHOD_TPS:
|
||||
return Sensor::get(SensorType::DriverThrottleIntent).value_or(0);
|
||||
case LE_METHOD_FUEL_FLOW_RATE:
|
||||
return engine->engineState.fuelConsumption.getConsumptionGramPerSecond();
|
||||
case LE_METHOD_OIL_PRESSURE:
|
||||
return Sensor::get(SensorType::OilPressure).value_or(0);
|
||||
// cfg_xxx references are code generated
|
||||
#include "fsio_getters.def"
|
||||
default:
|
||||
|
|
|
@ -331,7 +331,7 @@ struct spi_pins
|
|||
end_struct
|
||||
|
||||
|
||||
#define gppwm_channel_e_enum "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "INVALID", "INVALID"
|
||||
#define gppwm_channel_e_enum "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "Aux Temp 1", "Aux Temp 2"
|
||||
custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:2], @@gppwm_channel_e_enum@@
|
||||
|
||||
struct gppwm_channel
|
||||
|
|
Loading…
Reference in New Issue