wrap atdc timing correctly

This commit is contained in:
Matthew Kennedy 2023-07-21 13:00:28 -07:00
parent 6bbe6ba8b4
commit 4140b824fb
1 changed files with 5 additions and 0 deletions

View File

@ -80,6 +80,11 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_
// Pull any extra timing for knock retard
- engine->module<KnockController>()->getKnockRetard();
// 10 ATDC ends up as 710, convert it to -10 so we can log and clamp correctly
if (finalIgnitionTiming > 360) {
finalIgnitionTiming -= 720;
}
// Clamp the final ignition timing to the configured limits
// finalIgnitionTiming is deg BTDC
// minimumIgnitionTiming limits maximium retard