60/2 perf grab #1850

unused parameter
This commit is contained in:
rusefillc 2020-10-04 02:09:12 -04:00
parent c1023504e6
commit e6bac27c70
7 changed files with 12 additions and 14 deletions

View File

@ -368,12 +368,9 @@ uint32_t *cyccnt = (uint32_t*) &DWT->CYCCNT;
* This is the main trigger event handler.
* Both injection and ignition are controlled from this method.
*/
void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) {
void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) {
ScopePerf perf(PE::MainTriggerCallback);
(void) ckpSignalType;
if (CONFIG(vvtMode) == MIATA_NB2 && ENGINE(triggerCentral.vvtSyncTimeNt) == 0) {
// this is a bit spaghetti code for sure
// do not spark & do not fuel until we have VVT sync. NB2 is a special case

View File

@ -15,7 +15,7 @@
void initMainEventListener(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE);

View File

@ -267,14 +267,13 @@ void refreshMapAveragingPreCalc(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
/**
* Shaft Position callback used to schedule start and end of MAP averaging
*/
void mapAveragingTriggerCallback(trigger_event_e ckpEventType,
void mapAveragingTriggerCallback(
uint32_t index, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) {
ScopePerf perf(PE::MapAveragingTriggerCallback);
#if EFI_ENGINE_CONTROL
// this callback is invoked on interrupt thread
UNUSED(ckpEventType);
if (index != (uint32_t)CONFIG(mapAveragingSchedulingAtIndex))
return;
@ -290,12 +289,14 @@ void mapAveragingTriggerCallback(trigger_event_e ckpEventType,
measurementsPerRevolution = measurementsPerRevolutionCounter;
measurementsPerRevolutionCounter = 0;
// todo: this could be pre-calculated
int samplingCount = CONFIG(measureMapOnlyInOneCylinder) ? 1 : engineConfiguration->specs.cylindersCount;
for (int i = 0; i < samplingCount; i++) {
angle_t samplingStart = ENGINE(engineState.mapAveragingStart[i]);
angle_t samplingDuration = ENGINE(engineState.mapAveragingDuration);
// todo: this assertion could be moved out of trigger handler
assertAngleRange(samplingDuration, "samplingDuration", CUSTOM_ERR_6563);
if (samplingDuration <= 0) {
warning(CUSTOM_MAP_ANGLE_PARAM, "map sampling angle should be positive");
@ -310,6 +311,7 @@ void mapAveragingTriggerCallback(trigger_event_e ckpEventType,
return;
}
// todo: pre-calculate samplingEnd for each cylinder
fixAngle(samplingEnd, "samplingEnd", CUSTOM_ERR_6563);
// only if value is already prepared
int structIndex = getRevolutionCounter() % 2;

View File

@ -18,7 +18,7 @@ void mapAveragingAdcCallback(adcsample_t newValue);
void initMapAveraging(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
void refreshMapAveragingPreCalc(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void mapAveragingTriggerCallback(trigger_event_e ckpEventType,
void mapAveragingTriggerCallback(
uint32_t index, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
#if EFI_TUNER_STUDIO

View File

@ -325,9 +325,8 @@ static void onTdcCallback(Engine *engine) {
/**
* This trigger callback schedules the actual physical TDC callback in relation to trigger synchronization point.
*/
void tdcMarkCallback(trigger_event_e ckpSignalType,
void tdcMarkCallback(
uint32_t index0, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) {
(void) ckpSignalType;
bool isTriggerSynchronizationPoint = index0 == 0;
if (isTriggerSynchronizationPoint && ENGINE(isEngineChartEnabled)) {
// two instances of scheduling_s are needed to properly handle event overlap

View File

@ -156,7 +156,7 @@ private:
void rpmShaftPositionCallback(trigger_event_e ckpSignalType, uint32_t index, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
void tdcMarkCallback(trigger_event_e ckpSignalType,
void tdcMarkCallback(
uint32_t index0, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
/**

View File

@ -489,12 +489,12 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
rpmShaftPositionCallback(signal, triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
#if !EFI_UNIT_TEST
tdcMarkCallback(signal, triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
tdcMarkCallback(triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
#endif
#if !EFI_UNIT_TEST
#if EFI_SHAFT_POSITION_INPUT
mapAveragingTriggerCallback(signal, triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
mapAveragingTriggerCallback(triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
#endif /* EFI_SHAFT_POSITION_INPUT */
#endif /* EFI_UNIT_TEST */
@ -509,7 +509,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
(listener)(signal, triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
}
mainTriggerCallback(signal, triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
mainTriggerCallback(triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
}