From 2e0d30a64f630206913a27e63b0d0ecde14bdc30 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 12 May 2024 13:54:46 -0400 Subject: [PATCH] brakePedalPinInverted & throttlePedalPosition gauge improvement --- firmware/controllers/algo/engine.cpp | 2 +- firmware/integration/rusefi_config.txt | 2 +- firmware/tunerstudio/tunerstudio.template.ini | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 1cd423a657..9b80955d8a 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -235,7 +235,7 @@ static bool getClutchUpState() { static bool getBrakePedalState() { if (isBrainPinValid(engineConfiguration->brakePedalPin)) { - return efiReadPin(engineConfiguration->brakePedalPin); + return engineConfiguration->brakePedalPinInverted ^ efiReadPin(engineConfiguration->brakePedalPin); } // todo: boolean sensors should leverage sensor framework #6342 return engine->engineState.lua.brakePedalState; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 12ffd794fb..8be0b17e2e 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1192,7 +1192,7 @@ int16_t tps2Max;Full throttle#2. tpsMax value as 10 bit ADC value. Not Voltage!\ bit startRequestPinInverted,"Inverted","Normal" bit tcu_rangeSensorPulldown bit skipBoardCanDash - bit unusedBit_503_19 + bit brakePedalPinInverted,"Inverted","Normal" bit devBit0 bit devBit1 bit devBit2 diff --git a/firmware/tunerstudio/tunerstudio.template.ini b/firmware/tunerstudio/tunerstudio.template.ini index 33ad6deb23..340d7d54c2 100644 --- a/firmware/tunerstudio/tunerstudio.template.ini +++ b/firmware/tunerstudio/tunerstudio.template.ini @@ -1591,7 +1591,7 @@ gaugeCategory = Fueling currentTargetAfrGauge = targetAFR,"fuel: target AFR", "", 0.65, 1.2, 0.7, 0.75, 1.1, 1.15, 3, 2 gaugeCategory = Throttle Body (incl. ETB) - pedalPositionGauge = throttlePedalPosition, @@GAUGE_NAME_THROTTLE_PEDAL@@, "%", 0, 120, 0, 0, 100, 100, 1, 1 + pedalPositionGauge = throttlePedalPosition, @@GAUGE_NAME_THROTTLE_PEDAL@@, "%", -20, 120, -10, -5, 105, 110, 1, 1 tpsADCGauge = tpsADC, "tps1 ADC", "ADC", 0, 1024, 0, 0, 0, 0, 0, 0 TPSGauge = TPSValue, "Throttle position", "%", 0, 100, 0, 0, 100, 100, 1, 1 TPS2Gauge = TPS2Value, "Throttle position #2", "%", 0, 100, 0, 0, 100, 100, 1, 1 @@ -3096,6 +3096,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_ field = "Clutch Up mode", clutchUpPinMode field = "Throttle Up switch", throttlePedalUpPin field = "Brake Pedal", brakePedalPin + field = "Brake Pedak signal", brakePedalPinInverted field = "Brake Pedal Mode", brakePedalPinMode field = "Flex fuel sensor", flexSensorPin field = "Flex Signal", flexSensorInverted