auto-sync

This commit is contained in:
rusEfi 2015-04-16 00:04:50 -04:00
parent f082d8c51a
commit 094f45f041
4 changed files with 7 additions and 7 deletions

View File

@ -185,8 +185,8 @@ static void mapAveragingCallback(trigger_event_e ckpEventType, uint32_t index DE
int structIndex = getRevolutionCounter() % 2;
// todo: schedule this based on closest trigger event, same as ignition works
scheduleByAngle(rpm, &startTimer[structIndex], samplingStart, startAveraging, NULL);
scheduleByAngle(rpm, &endTimer[structIndex], samplingStart + samplingDuration, endAveraging, NULL);
scheduleByAngle(rpm, &startTimer[structIndex], samplingStart, startAveraging, NULL, &engine->rpmCalculator);
scheduleByAngle(rpm, &endTimer[structIndex], samplingStart + samplingDuration, endAveraging, NULL, &engine->rpmCalculator);
engine->m.mapAveragingCbTime = GET_TIMESTAMP() - engine->m.beforeMapAveragingCb;
}

View File

@ -205,7 +205,7 @@ static void tdcMarkCallback(trigger_event_e ckpSignalType, uint32_t index0 DECLA
int rpm = getRpm();
// todo: use event-based scheduling, not just time-based scheduling
scheduleByAngle(rpm, &tdcScheduler[revIndex2], tdcPosition(),
(schfunc_t) onTdcCallback, NULL);
(schfunc_t) onTdcCallback, NULL, &engine->rpmCalculator);
}
}
#endif
@ -248,7 +248,7 @@ void initRpmCalculator(Engine *engine) {
* The callback would be executed once after the duration of time which
* it takes the crankshaft to rotate to the specified angle.
*/
void scheduleByAngle(int rpm, scheduling_s *timer, angle_t angle, schfunc_t callback, void *param) {
void scheduleByAngle(int rpm, scheduling_s *timer, angle_t angle, schfunc_t callback, void *param, RpmCalculator *calc) {
if (!isValidRpm(rpm)) {
/**
* this might happen in case of a single trigger event after a pause - this is normal, so no

View File

@ -103,6 +103,6 @@ bool isCranking(void);
#define addWaveChartEvent(n, msg) {}
#endif /* EFI_WAVE_CHART */
void scheduleByAngle(int rpm, scheduling_s *timer, angle_t angle, schfunc_t callback, void *param);
void scheduleByAngle(int rpm, scheduling_s *timer, angle_t angle, schfunc_t callback, void *param, RpmCalculator *calc);
#endif /* RPM_REPORTER_H_ */

View File

@ -173,10 +173,10 @@ static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index DECLARE
int structIndex = getRevolutionCounter() % 2;
// todo: schedule this based on closest trigger event, same as ignition works
scheduleByAngle(rpm, &startTimer[structIndex], engineConfiguration->knockDetectionWindowStart,
(schfunc_t) &startIntegration, NULL);
(schfunc_t) &startIntegration, NULL, &engine->rpmCalculator);
scheduleByAngle(rpm, &endTimer[structIndex], engineConfiguration->knockDetectionWindowEnd,
(schfunc_t) &endIntegration,
NULL);
NULL, &engine->rpmCalculator);
engine->m.hipCbTime = GET_TIMESTAMP() - engine->m.beforeHipCb;
}