parent
0a550a70b1
commit
77ebc71f9a
|
@ -139,6 +139,13 @@ static void fireTrailingSpark(IgnitionOutputPin* pin) {
|
|||
pin->setLow();
|
||||
}
|
||||
|
||||
static void overFireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
|
||||
#if SPARK_EXTREME_LOGGING
|
||||
efiPrintf("overFireSparkAndPrepareNextSchedule %s", event->outputs[0]->name);
|
||||
#endif /* SPARK_EXTREME_LOGGING */
|
||||
fireSparkAndPrepareNextSchedule(event);
|
||||
}
|
||||
|
||||
void fireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
|
||||
for (int i = 0; i< MAX_OUTPUTS_FOR_IGNITION;i++) {
|
||||
IgnitionOutputPin *output = event->outputs[i];
|
||||
|
@ -202,6 +209,9 @@ if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
|
|||
|
||||
efitick_t nextDwellStart = nowNt + engine->engineState.multispark.delay;
|
||||
efitick_t nextFiring = nextDwellStart + engine->engineState.multispark.dwell;
|
||||
#if SPARK_EXTREME_LOGGING
|
||||
efiPrintf("schedule multispark");
|
||||
#endif /* SPARK_EXTREME_LOGGING */
|
||||
|
||||
// We can schedule both of these right away, since we're going for "asap" not "particular angle"
|
||||
engine->executor.scheduleByTimestampNt("dwell", &event->dwellStartTimer, nextDwellStart, { &turnSparkPinHigh, event });
|
||||
|
@ -424,7 +434,8 @@ static void handleSparkEvent(bool limitedSpark, uint32_t trgEventIndex, Ignition
|
|||
if (!limitedSpark && engine->enableOverdwellProtection) {
|
||||
// auto fire spark at 1.5x nominal dwell
|
||||
efitick_t fireTime = chargeTime + MSF2NT(1.5f * dwellMs);
|
||||
engine->executor.scheduleByTimestampNt("overdwell", &event->sparkEvent.scheduling, fireTime, { fireSparkAndPrepareNextSchedule, event });
|
||||
engine->executor.scheduleByTimestampNt("overdwell", &event->sparkEvent.scheduling, fireTime, { overFireSparkAndPrepareNextSchedule, event });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,10 @@ TEST(ignition, twoCoils) {
|
|||
TEST(ignition, trailingSpark) {
|
||||
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
|
||||
|
||||
/**
|
||||
// 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(_))
|
||||
|
|
Loading…
Reference in New Issue