refactoring: removing unused parameter

This commit is contained in:
rusefi 2019-11-05 22:49:11 -05:00
parent d4574a3cab
commit eb4ceda52b
5 changed files with 10 additions and 12 deletions

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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_ */

View File

@ -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;
}