auto-sync

This commit is contained in:
rusEfi 2016-07-23 23:03:45 -04:00
parent b2bb7f6c44
commit 5a5b1eb92d
1 changed files with 8 additions and 0 deletions

View File

@ -110,6 +110,14 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int eventIndex, bool limitedF
*/
const floatms_t injectionDuration = ENGINE(wallFuel).adjust(event->injectorIndex, ENGINE(fuelMs) PASS_ENGINE_PARAMETER);
// todo: pre-calculate 'numberOfInjections'
floatms_t totalPerCycle = injectionDuration * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER);
floatus_t engineCycleDuration = engine->rpmCalculator.oneDegreeUs * engine->engineCycle;
if (MS2US(totalPerCycle) > engineCycleDuration) {
warning(CUSTOM_OBD_26, "injector duty cycle too high %fms @ %d", totalPerCycle,
getRevolutionCounter());
}
ENGINE(actualLastInjection) = injectionDuration;
if (cisnan(injectionDuration)) {
warning(CUSTOM_OBD_NAN_INJECTION, "NaN injection pulse");