From ab49f61a8353a23231eab54244d0d1fb157e8f03 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sat, 31 Jul 2021 18:20:19 -0700 Subject: [PATCH] gppwm vbatt axis (#3088) --- firmware/controllers/actuators/gppwm/gppwm_channel.cpp | 2 ++ firmware/controllers/algo/rusefi_enums.h | 1 + firmware/integration/rusefi_config.txt | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp index 6be49fb380..65f196076c 100644 --- a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp +++ b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp @@ -28,6 +28,8 @@ expected readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETE return 0; case GPPWM_AccelPedal: return Sensor::get(SensorType::AcceleratorPedal); + case GPPWM_Vbatt: + return Sensor::get(SensorType::BatteryVoltage); } return unexpected; diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 3b2e979488..ac8ecfd7b6 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -1022,6 +1022,7 @@ typedef enum __attribute__ ((__packed__)) { GPPWM_AuxTemp2 = 7, GPPWM_Zero = 8, GPPWM_AccelPedal = 9, + GPPWM_Vbatt = 10, } gppwm_channel_e; typedef enum __attribute__ ((__packed__)) { diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index f38010160f..76784cfa98 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -336,7 +336,7 @@ struct spi_pins end_struct -#define gppwm_channel_e_enum "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "Aux Temp 1", "Aux Temp 2", "Zero", "Accel Pedal" +#define gppwm_channel_e_enum "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "Aux Temp 1", "Aux Temp 2", "Zero", "Accel Pedal", "Battery Voltage" custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:3], @@gppwm_channel_e_enum@@ struct gppwm_channel