detected gear available as gppwm channel

This commit is contained in:
Matthew Kennedy 2023-03-31 22:29:36 -07:00
parent e1a7a4cff4
commit f29b51d490
3 changed files with 4 additions and 1 deletions

View File

@ -66,6 +66,8 @@ expected<float> readGppwmChannel(gppwm_channel_e channel) {
return (float)engine->outputChannels.gppwmOutput[2];
case GPPWM_GppwmOutput4:
return (float)engine->outputChannels.gppwmOutput[3];
case GPPWM_DetectedGear:
return engine->module<GearDetector>()->getCurrentGear();
}
return unexpected;

View File

@ -554,6 +554,7 @@ typedef enum __attribute__ ((__packed__)) {
GPPWM_LuaGauge1 = 22,
GPPWM_LuaGauge2 = 23,
GPPWM_Rpm = 24,
GPPWM_DetectedGear = 25,
} gppwm_channel_e;
typedef enum __attribute__ ((__packed__)) {

View File

@ -313,7 +313,7 @@ struct spi_pins
Gpio sckPin;
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", "Lua Gauge 1", "Lua Gauge 2", "RPM"
#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)"
custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:4], @@gppwm_channel_e_enum@@
struct gppwm_channel