Lua aux gauge #4672

This commit is contained in:
rusefillc 2022-10-17 21:21:23 -04:00
parent 7ff0d6dce9
commit 69a503a0ee
4 changed files with 8 additions and 1 deletions

View File

@ -513,6 +513,7 @@ static void updateRawSensors() {
engine->outputChannels.rawIdlePositionSensor = Sensor::getRaw(SensorType::IdlePosition);
engine->outputChannels.luaGauges[0] = Sensor::getRaw(SensorType::LuaGauge1);
engine->outputChannels.luaGauges[1] = Sensor::getRaw(SensorType::LuaGauge2);
for (int i = 0;i<AUX_ANALOG_INPUT_COUNT;i++) {
adc_channel_e ch = engineConfiguration->auxAnalogInputs[i];

View File

@ -18,6 +18,10 @@ expected<float> readGppwmChannel(gppwm_channel_e channel) {
return Sensor::get(SensorType::Clt);
case GPPWM_Iat:
return Sensor::get(SensorType::Iat);
case GPPWM_LuaGauge1:
return Sensor::get(SensorType::LuaGauge1);
case GPPWM_LuaGauge2:
return Sensor::get(SensorType::LuaGauge2);
case GPPWM_FuelLoad:
return getFuelingLoad();
case GPPWM_IgnLoad:

View File

@ -559,6 +559,8 @@ typedef enum __attribute__ ((__packed__)) {
GPPWM_GppwmOutput2 = 19,
GPPWM_GppwmOutput3 = 20,
GPPWM_GppwmOutput4 = 21,
GPPWM_LuaGauge1 = 22,
GPPWM_LuaGauge2 = 23,
} gppwm_channel_e;
typedef enum __attribute__ ((__packed__)) {

View File

@ -349,7 +349,7 @@ struct spi_pins
end_struct
#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"
#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"
custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:4], @@gppwm_channel_e_enum@@
struct gppwm_channel