auto-sync
This commit is contained in:
parent
d5ecf3ad7c
commit
165bac36b0
|
@ -98,8 +98,9 @@ static void endSimultaniousInjection(Engine *engine) {
|
||||||
|
|
||||||
static ALWAYS_INLINE void handleFuelInjectionEvent(int eventIndex, bool limitedFuel, InjectionEvent *event,
|
static ALWAYS_INLINE void handleFuelInjectionEvent(int eventIndex, bool limitedFuel, InjectionEvent *event,
|
||||||
int rpm DECLARE_ENGINE_PARAMETER_S) {
|
int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||||
if (limitedFuel)
|
if (limitedFuel) {
|
||||||
return; // todo: move this check up
|
return; // todo: move this check up
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* todo: this is a bit tricky with batched injection. is it? Does the same
|
* todo: this is a bit tricky with batched injection. is it? Does the same
|
||||||
|
@ -118,8 +119,9 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int eventIndex, bool limitedF
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engine->isCylinderCleanupMode)
|
if (engine->isCylinderCleanupMode) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
floatus_t injectionStartDelayUs = ENGINE(rpmCalculator.oneDegreeUs) * event->injectionStart.angleOffset;
|
floatus_t injectionStartDelayUs = ENGINE(rpmCalculator.oneDegreeUs) * event->injectionStart.angleOffset;
|
||||||
|
|
||||||
|
@ -145,6 +147,12 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int eventIndex, bool limitedF
|
||||||
printf("scheduling injection angle=%f/delay=%f injectionDuration=%f\r\n", event->injectionStart.angleOffset, injectionStartDelayUs, injectionDuration);
|
printf("scheduling injection angle=%f/delay=%f injectionDuration=%f\r\n", event->injectionStart.angleOffset, injectionStartDelayUs, injectionDuration);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// we are in this branch of code only in case of NOT IM_SIMULTANEOUS injection
|
||||||
|
if (rpm > 2 * engineConfiguration->cranking.rpm) {
|
||||||
|
const char *outputName = event->output->name;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
scheduleOutput(signal, getTimeNowUs(), injectionStartDelayUs, MS2US(injectionDuration), event->output);
|
scheduleOutput(signal, getTimeNowUs(), injectionStartDelayUs, MS2US(injectionDuration), event->output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -171,12 +179,12 @@ static ALWAYS_INLINE void handleFuel(bool limitedFuel, uint32_t eventIndex, int
|
||||||
|
|
||||||
ENGINE(fuelMs) = getFuelMs(rpm PASS_ENGINE_PARAMETER) * CONFIG(globalFuelCorrection);
|
ENGINE(fuelMs) = getFuelMs(rpm PASS_ENGINE_PARAMETER) * CONFIG(globalFuelCorrection);
|
||||||
|
|
||||||
for (int eventIndex = 0; eventIndex < injectionEvents->size; eventIndex++) {
|
for (int injEventIndex = 0; injEventIndex < injectionEvents->size; injEventIndex++) {
|
||||||
InjectionEvent *event = &injectionEvents->elements[eventIndex];
|
InjectionEvent *event = &injectionEvents->elements[injEventIndex];
|
||||||
if (event->injectionStart.eventIndex != eventIndex) {
|
if (event->injectionStart.eventIndex != eventIndex) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
handleFuelInjectionEvent(eventIndex, limitedFuel, event, rpm PASS_ENGINE_PARAMETER);
|
handleFuelInjectionEvent(injEventIndex, limitedFuel, event, rpm PASS_ENGINE_PARAMETER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue