BUGFIX: console engine sniffer was not displaying TDC mark properly in cases of negative angles

This commit is contained in:
rusefi 2020-04-20 22:43:55 -04:00
parent bae38f03ce
commit 799bd8489f
1 changed files with 3 additions and 1 deletions

View File

@ -319,7 +319,9 @@ static void tdcMarkCallback(trigger_event_e ckpSignalType,
int rpm = GET_RPM();
// todo: use tooth event-based scheduling, not just time-based scheduling
if (isValidRpm(rpm)) {
scheduleByAngle(&tdcScheduler[revIndex2], edgeTimestamp, tdcPosition(),
angle_t tdcPosition = tdcPosition();
fixAngle(tdcPosition, "tdcPosition", CUSTOM_ERR_6553);
scheduleByAngle(&tdcScheduler[revIndex2], edgeTimestamp, tdcPosition,
{ onTdcCallback, engine } PASS_ENGINE_PARAMETER_SUFFIX);
}
}