Skip to content

Commit

Permalink
enableOverdwellProtection
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Jan 3, 2025
1 parent 9f4b660 commit f81dff1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
3 changes: 0 additions & 3 deletions firmware/controllers/algo/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ class Engine final : public TriggerStateListener {
public:
Engine();

// todo: technical debt: enableOverdwellProtection #3553
bool enableOverdwellProtection = true;

TunerStudioOutputChannels outputChannels;

/**
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/engine_cycle/spark_logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}));

Expand All @@ -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);
Expand Down

0 comments on commit f81dff1

Please sign in to comment.