per-cylinder logging fix: using better sign

This commit is contained in:
rusefillc 2023-05-31 17:44:33 -04:00
parent ed18cb1a53
commit 800752d389
1 changed files with 8 additions and 8 deletions

View File

@ -85,13 +85,13 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_
// let's save planned duration so that we can later compare it with reality // let's save planned duration so that we can later compare it with reality
event->sparkDwell = sparkDwell; event->sparkDwell = sparkDwell;
angle_t correctedSparkAngle = angle_t finalIgnitionTiming = getEngineState()->timingAdvance[event->cylinderNumber];
engine->outputChannels.ignitionAdvanceCyl[event->cylinderIndex] = finalIgnitionTiming;
angle_t sparkAngle =
// Negate because timing *before* TDC, and we schedule *after* TDC // Negate because timing *before* TDC, and we schedule *after* TDC
- getEngineState()->timingAdvance[event->cylinderNumber]; - finalIgnitionTiming
engine->outputChannels.ignitionAdvanceCyl[event->cylinderIndex] = correctedSparkAngle;
angle_t sparkAngle = correctedSparkAngle
// Offset by this cylinder's position in the cycle // Offset by this cylinder's position in the cycle
+ getPerCylinderFiringOrderOffset(event->cylinderIndex, event->cylinderNumber); + getPerCylinderFiringOrderOffset(event->cylinderIndex, event->cylinderNumber);