diff --git a/firmware/controllers/map_averaging.cpp b/firmware/controllers/map_averaging.cpp index 71d6b12f73..bfd1959a7d 100644 --- a/firmware/controllers/map_averaging.cpp +++ b/firmware/controllers/map_averaging.cpp @@ -266,7 +266,7 @@ static void mapAveragingTriggerCallback(trigger_event_e ckpEventType, #if EFI_ENGINE_CONTROL // this callback is invoked on interrupt thread UNUSED(ckpEventType); - if (index != CONFIG(mapAveragingSchedulingAtIndex)) + if (index != (uint32_t)CONFIG(mapAveragingSchedulingAtIndex)) return; engine->m.beforeMapAveragingCb = getTimeNowLowerNt(); @@ -310,9 +310,9 @@ static void mapAveragingTriggerCallback(trigger_event_e ckpEventType, // we are loosing precision in case of changing RPM - the further away is the event the worse is precision // todo: schedule this based on closest trigger event, same as ignition works scheduleByAngle(rpm, &startTimer[i][structIndex], samplingStart, - startAveraging, NULL, &engine->rpmCalculator PASS_ENGINE_PARAMETER_SUFFIX); + startAveraging, NULL PASS_ENGINE_PARAMETER_SUFFIX); scheduleByAngle(rpm, &endTimer[i][structIndex], samplingEnd, - endAveraging, NULL, &engine->rpmCalculator PASS_ENGINE_PARAMETER_SUFFIX); + endAveraging, NULL PASS_ENGINE_PARAMETER_SUFFIX); engine->m.mapAveragingCbTime = getTimeNowLowerNt() - engine->m.beforeMapAveragingCb; } diff --git a/firmware/controllers/trigger/aux_valves.cpp b/firmware/controllers/trigger/aux_valves.cpp index c699568a02..593c09688a 100644 --- a/firmware/controllers/trigger/aux_valves.cpp +++ b/firmware/controllers/trigger/aux_valves.cpp @@ -66,12 +66,12 @@ static void auxValveTriggerCallback(trigger_event_e ckpSignalType, fixAngle(onTime, "onTime", CUSTOM_ERR_6556); scheduleByAngle(rpm, &turnOnEvent[valveIndex][phaseIndex], onTime, - (schfunc_t) &turnOn, output, &engine->rpmCalculator); + (schfunc_t) &turnOn, output); angle_t offTime = extra + engine->engineState.auxValveEnd; fixAngle(offTime, "offTime", CUSTOM_ERR_6557); scheduleByAngle(rpm, &turnOffEvent[valveIndex][phaseIndex], offTime, - (schfunc_t) &turnOff, output, &engine->rpmCalculator); + (schfunc_t) &turnOff, output); } } diff --git a/firmware/controllers/trigger/rpm_calculator.cpp b/firmware/controllers/trigger/rpm_calculator.cpp index 76b7d47cad..812c74e6d2 100644 --- a/firmware/controllers/trigger/rpm_calculator.cpp +++ b/firmware/controllers/trigger/rpm_calculator.cpp @@ -314,7 +314,7 @@ static void tdcMarkCallback(trigger_event_e ckpSignalType, // todo: use tooth event-based scheduling, not just time-based scheduling if (isValidRpm(rpm)) { scheduleByAngle(rpm, &tdcScheduler[revIndex2], tdcPosition(), - (schfunc_t) onTdcCallback, NULL, &engine->rpmCalculator); + (schfunc_t) onTdcCallback, NULL); } } } @@ -355,9 +355,7 @@ void initRpmCalculator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { * 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, RpmCalculator *calc DECLARE_ENGINE_PARAMETER_SUFFIX) { - // todo: remove 'calc' parameter - UNUSED(rpm); + schfunc_t callback, void *param DECLARE_ENGINE_PARAMETER_SUFFIX) { efiAssertVoid(CUSTOM_ANGLE_NAN, !cisnan(angle), "NaN angle?"); efiAssertVoid(CUSTOM_ERR_6634, isValidRpm(rpm), "RPM check expected"); float delayUs = ENGINE(rpmCalculator.oneDegreeUs) * angle; diff --git a/firmware/controllers/trigger/rpm_calculator.h b/firmware/controllers/trigger/rpm_calculator.h index eec0a6ff31..b5d80442a7 100644 --- a/firmware/controllers/trigger/rpm_calculator.h +++ b/firmware/controllers/trigger/rpm_calculator.h @@ -166,6 +166,6 @@ float getCrankshaftAngleNt(efitime_t timeNt DECLARE_ENGINE_PARAMETER_SUFFIX); #define addEngineSnifferEvent(n, msg) {} #endif /* EFI_ENGINE_SNIFFER */ -void scheduleByAngle(int rpm, scheduling_s *timer, angle_t angle, schfunc_t callback, void *param, RpmCalculator *calc DECLARE_ENGINE_PARAMETER_SUFFIX); +void scheduleByAngle(int rpm, scheduling_s *timer, angle_t angle, schfunc_t callback, void *param DECLARE_ENGINE_PARAMETER_SUFFIX); #endif /* RPM_REPORTER_H_ */ diff --git a/firmware/hw_layer/hip9011.cpp b/firmware/hw_layer/hip9011.cpp index 464d94cd21..bbedf7ad85 100644 --- a/firmware/hw_layer/hip9011.cpp +++ b/firmware/hw_layer/hip9011.cpp @@ -255,13 +255,13 @@ 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, &engine->rpmCalculator); + (schfunc_t) &startIntegration, NULL PASS_ENGINE_PARAMETER_SUFFIX); #if EFI_PROD_CODE hipLastExecutionCount = lastExecutionCount; #endif /* EFI_PROD_CODE */ scheduleByAngle(rpm, &endTimer[structIndex], engineConfiguration->knockDetectionWindowEnd, (schfunc_t) &endIntegration, - NULL, &engine->rpmCalculator); + NULL PASS_ENGINE_PARAMETER_SUFFIX); engine->m.hipCbTime = getTimeNowLowerNt() - engine->m.beforeHipCb; }