From 06437f304f61ec7936a299738ff6ab074b86cda7 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 3 Feb 2022 05:01:21 -0800 Subject: [PATCH] dead StartupFuelPumping (#3883) * dead * test * dead config too --- firmware/controllers/algo/engine2.cpp | 35 ------------------ .../controllers/algo/engine_configuration.cpp | 2 -- firmware/controllers/algo/engine_parts.h | 16 --------- firmware/integration/rusefi_config.txt | 2 +- .../tests/trigger/test_trigger_decoder.cpp | 36 ------------------- 5 files changed, 1 insertion(+), 90 deletions(-) diff --git a/firmware/controllers/algo/engine2.cpp b/firmware/controllers/algo/engine2.cpp index f838fcf1f8..b4234bd856 100644 --- a/firmware/controllers/algo/engine2.cpp +++ b/firmware/controllers/algo/engine2.cpp @@ -214,41 +214,6 @@ int MockAdcState::getMockAdcValue(int hwChannel) const { return fakeAdcValues[hwChannel]; } -StartupFuelPumping::StartupFuelPumping() { - isTpsAbove50 = false; - pumpsCounter = 0; -} - -void StartupFuelPumping::setPumpsCounter(int newValue) { - if (pumpsCounter != newValue) { - pumpsCounter = newValue; - - if (pumpsCounter == PUMPS_TO_PRIME) { - efiPrintf("let's squirt prime pulse %.2f", pumpsCounter); - pumpsCounter = 0; - } else { - efiPrintf("setPumpsCounter %d", pumpsCounter); - } - } -} - -void StartupFuelPumping::update() { - if (Sensor::getOrZero(SensorType::Rpm) == 0) { - bool isTpsAbove50 = Sensor::getOrZero(SensorType::DriverThrottleIntent) >= 50; - - if (this->isTpsAbove50 != isTpsAbove50) { - setPumpsCounter(pumpsCounter + 1); - } - - } else { - /** - * Engine is not stopped - not priming pumping mode - */ - setPumpsCounter(0); - isTpsAbove50 = false; - } -} - #if EFI_SIMULATOR #define VCS_VERSION "123" #endif diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 8ba09a7bbf..de352a48df 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -673,8 +673,6 @@ static void setDefaultEngineConfiguration() { engineConfiguration->engineChartSize = 400; #endif - engineConfiguration->primingSquirtDurationMs = 5; - engineConfiguration->isMapAveragingEnabled = true; engineConfiguration->isWaveAnalyzerEnabled = true; diff --git a/firmware/controllers/algo/engine_parts.h b/firmware/controllers/algo/engine_parts.h index 4ae59dcef4..d967f27877 100644 --- a/firmware/controllers/algo/engine_parts.h +++ b/firmware/controllers/algo/engine_parts.h @@ -72,22 +72,6 @@ public: warningBuffer_t recentWarnings; }; -/** - * 6 crossing over 50% TPS means pressing and releasing three times - * TODO: looks like this code is not finished / not used? - */ -#define PUMPS_TO_PRIME 6 - -class StartupFuelPumping { -public: - StartupFuelPumping(); - void update(); - bool isTpsAbove50; - int pumpsCounter; -private: - void setPumpsCounter(int newValue); -}; - struct multispark_state { efitick_t delay = 0; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 3764a9b4dd..5eb9c43879 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -479,7 +479,7 @@ int16_t tpsErrorDetectionTooLow;+TPS error detection: what throttle % is unreali int16_t tpsErrorDetectionTooHigh;+TPS error detection: what throttle % is unrealistically high?\nAlso used for accelerator pedal error detection if so equiped.;"%", 1, 0, 100, 110, 0 cranking_parameters_s cranking -float primingSquirtDurationMs;;"*C", 1, 0, -40, 200, 1 +float unused184;;"",1,0,0,0,0 float ignitionDwellForCrankingMs;+Dwell duration while cranking;"ms", 1, 0, 0, 200, 1 uint16_t etbRevLimitStart;+Once engine speed passes this value, start reducing ETB angle.;"rpm", 1, 0, 0, 15000, 0 uint16_t etbRevLimitRange;+This far above 'Soft limiter start', fully close the throttle. At the bottom of the range, throttle control is normal. At the top of the range, the throttle is fully closed.;"rpm", 1, 0, 0, 2000, 0 diff --git a/unit_tests/tests/trigger/test_trigger_decoder.cpp b/unit_tests/tests/trigger/test_trigger_decoder.cpp index d40b617bb8..c1bbd1e585 100644 --- a/unit_tests/tests/trigger/test_trigger_decoder.cpp +++ b/unit_tests/tests/trigger/test_trigger_decoder.cpp @@ -246,42 +246,6 @@ static void testTriggerDecoder3(const char *msg, engine_type_e type, int synchPo assertEqualsM2("actual gap ratio", expectedGap, actualSynchGap, 0.001); } -TEST(misc, testStartupFuelPumping) { - EngineTestHelper eth(FORD_INLINE_6_1995); - - StartupFuelPumping sf; - - Sensor::setMockValue(SensorType::Rpm, 0); - - Sensor::setMockValue(SensorType::DriverThrottleIntent, 60); - sf.update(); - ASSERT_EQ( 1, sf.pumpsCounter) << "pc#1"; - - Sensor::setMockValue(SensorType::DriverThrottleIntent, 30); - sf.update(); - ASSERT_EQ( 1, sf.pumpsCounter) << "pumpsCounter#2"; - - sf.update(); - ASSERT_EQ( 1, sf.pumpsCounter) << "pc#3"; - - Sensor::setMockValue(SensorType::Rpm, 10); - sf.update(); - ASSERT_EQ( 0, sf.pumpsCounter) << "pc#4"; - - Sensor::setMockValue(SensorType::DriverThrottleIntent, 70); - Sensor::setMockValue(SensorType::Rpm, 0); - sf.update(); - ASSERT_EQ( 1, sf.pumpsCounter) << "pc#5"; - - Sensor::setMockValue(SensorType::DriverThrottleIntent, 30); - sf.update(); - ASSERT_EQ( 1, sf.pumpsCounter) << "pc#6"; - - Sensor::setMockValue(SensorType::DriverThrottleIntent, 70); - sf.update(); - ASSERT_EQ( 2, sf.pumpsCounter) << "pc#7"; -} - static void assertREquals(void *expected, void *actual) { ASSERT_EQ((float)(uint64_t)expected, (float)(uint64_t)actual); }