From f81dff184e1bd9dfcc05b3fdd130f11d5ba49562 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 2 Jan 2025 22:04:56 -0800 Subject: [PATCH] enableOverdwellProtection --- firmware/controllers/algo/engine.h | 3 --- firmware/controllers/engine_cycle/spark_logic.cpp | 2 +- .../ignition_injection/test_ignition_scheduling.cpp | 9 +-------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 6e8cb61537..766d7d7480 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -111,9 +111,6 @@ class Engine final : public TriggerStateListener { public: Engine(); - // todo: technical debt: enableOverdwellProtection #3553 - bool enableOverdwellProtection = true; - TunerStudioOutputChannels outputChannels; /** diff --git a/firmware/controllers/engine_cycle/spark_logic.cpp b/firmware/controllers/engine_cycle/spark_logic.cpp index b0f5740987..8743e6a42c 100644 --- a/firmware/controllers/engine_cycle/spark_logic.cpp +++ b/firmware/controllers/engine_cycle/spark_logic.cpp @@ -304,7 +304,7 @@ static void scheduleSparkEvent(bool limitedSpark, IgnitionEvent *event, float dw { fireSparkAndPrepareNextSchedule, event }, currentPhase, nextPhase); - if (!scheduled && !limitedSpark && engine->enableOverdwellProtection) { + if (!scheduled && !limitedSpark) { // If spark firing wasn't already scheduled, schedule the overdwell event at // 1.5x nominal dwell, should the trigger disappear before its scheduled for real efitick_t fireTime = chargeTime + (uint32_t)MSF2NT(1.5f * dwellMs); diff --git a/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp b/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp index 28afc3d2d1..6a1a67449f 100644 --- a/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp +++ b/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp @@ -48,12 +48,6 @@ TEST(ignition, trailingSpark) { EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = false; - /** - // TODO #3220: this feature makes this test sad, eventually remove this line (and the ability to disable it altogether) - * I am pretty sure that it's about usage of improper method clearQueue() below see it's comment - */ - engine->enableOverdwellProtection = false; - EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _)) .WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f})); @@ -74,12 +68,11 @@ TEST(ignition, trailingSpark) { // still no RPM since need to cycles measure cycle duration eth.fireTriggerEventsWithDuration(20); ASSERT_EQ( 3000, Sensor::getOrZero(SensorType::Rpm)) << "RPM#0"; - eth.clearQueue(); /** * Trigger up - scheduling fuel for full engine cycle */ - eth.fireRise(20); + eth.smartFireRise(20); // Primary coil should be high EXPECT_EQ(enginePins.coils[0].getLogicValue(), true);