From 4d1d2672ce5552a20586bbae08315ee59dd5fdce Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Fri, 7 Feb 2020 18:20:14 -0800 Subject: [PATCH] tps header cleanup (#1130) * tps header cleanup * dead code --- firmware/controllers/sensors/tps.cpp | 19 ++----------------- firmware/controllers/sensors/tps.h | 4 ---- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/firmware/controllers/sensors/tps.cpp b/firmware/controllers/sensors/tps.cpp index 73b20e0ce1..b9f0426de5 100644 --- a/firmware/controllers/sensors/tps.cpp +++ b/firmware/controllers/sensors/tps.cpp @@ -135,20 +135,13 @@ percent_t getTpsValue(int index, float adc DECLARE_ENGINE_PARAMETER_SUFFIX) { return maxF(0, minF(100, result)); } -/* - * Return voltage on TPS AND channel - * */ -float getTPSVoltage(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - return getVoltageDivided("tps", engineConfiguration->tps1_1AdcChannel PASS_ENGINE_PARAMETER_SUFFIX); -} - /* * Return TPS ADC readings. * We need ADC value because TunerStudio has a nice TPS configuration wizard, and this wizard * wants a TPS value. * @param index [0, ETB_COUNT) */ -float getTPS10bitAdc(int index DECLARE_ENGINE_PARAMETER_SUFFIX) { +static float getTPS10bitAdc(int index DECLARE_ENGINE_PARAMETER_SUFFIX) { #if !EFI_PROD_CODE if (engine->mockTpsAdcValue != MOCK_UNDEFINED) { return engine->mockTpsAdcValue; @@ -234,7 +227,7 @@ percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return maxF(0, minF(100, result)); } -bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return engineConfiguration->tps1_1AdcChannel != EFI_ADC_NONE; } @@ -257,14 +250,6 @@ percent_t getTPS(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return getTPSWithIndex(0 PASS_ENGINE_PARAMETER_SUFFIX); } -void setBosch0280750009(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - // see http://rusefi.com/wiki/index.php?title=Vehicle:VW_Passat_2002_1.8 - engineConfiguration->tpsMin = 159; - engineConfiguration->tpsMax = 957; - - // todo: add 2nd TPS sensor calibration -} - int convertVoltageTo10bitADC(float voltage) { // divided by 2 because of voltage divider, then converted into 10bit ADC value (TunerStudio format) return (int) (voltage * TPS_TS_CONVERSION); diff --git a/firmware/controllers/sensors/tps.h b/firmware/controllers/sensors/tps.h index a0a708bbf9..fe1e9f3505 100644 --- a/firmware/controllers/sensors/tps.h +++ b/firmware/controllers/sensors/tps.h @@ -24,13 +24,9 @@ percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_SIGNATURE); */ percent_t getTPS(DECLARE_ENGINE_PARAMETER_SIGNATURE); percent_t getTPSWithIndex(int index DECLARE_ENGINE_PARAMETER_SUFFIX); -bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE); int convertVoltageTo10bitADC(float voltage); -float getTPS10bitAdc(int index DECLARE_ENGINE_PARAMETER_SUFFIX); bool hasSecondThrottleBody(DECLARE_ENGINE_PARAMETER_SIGNATURE); -float getTPSVoltage(DECLARE_ENGINE_PARAMETER_SIGNATURE); percent_t getTpsValue(int index, float adc DECLARE_ENGINE_PARAMETER_SUFFIX); -void setBosch0280750009(DECLARE_ENGINE_PARAMETER_SIGNATURE); void setMockTpsAdc(percent_t tpsPosition DECLARE_ENGINE_PARAMETER_SUFFIX); void setMockTpsValue(percent_t tpsPosition DECLARE_ENGINE_PARAMETER_SUFFIX); void setMockThrottlePedalPosition(percent_t value DECLARE_ENGINE_PARAMETER_SUFFIX);