Smart ECU: misfire detection #936

This commit is contained in:
rusefillc 2021-09-06 10:35:26 -04:00
parent b17bebcbb9
commit a555b7a00f
1 changed files with 7 additions and 0 deletions

View File

@ -533,6 +533,13 @@ void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm
IgnitionEvent *event = &ENGINE(ignitionEvents.elements[i]);
if (event->dwellPosition.triggerEventIndex != trgEventIndex)
continue;
if (i == 0 && CONFIG(artificialTestMisfire) && (engine->globalSparkIdCounter % ((int)engineConfiguration->fsio_setting[5]) == 0)) {
// artificial misfire on cylinder #1 for testing purposes
warning(CUSTOM_ERR_6729, "artificial misfire on cylinder #1 for testing purposes %d", engine->globalSparkIdCounter);
continue;
}
handleSparkEvent(limitedSpark, trgEventIndex, event, rpm, edgeTimestamp PASS_ENGINE_PARAMETER_SUFFIX);
}
}