refactoring - proper variable name
This commit is contained in:
rusefi 2017-11-06 18:46:37 -05:00
parent 7dd16b474a
commit 2a27c706ea
1 changed files with 4 additions and 4 deletions

View File

@ -133,20 +133,20 @@ percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
float theoreticalInjectionLength; float theoreticalInjectionLength;
bool isCranking = ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE); bool isCranking = ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE);
int numberOfCylinders = getNumberOfInjections(isCranking ? int numberOfInjections = getNumberOfInjections(isCranking ?
engineConfiguration->crankingInjectionMode : engineConfiguration->crankingInjectionMode :
engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX); engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX);
if (numberOfCylinders == 0) { if (numberOfInjections == 0) {
warning(CUSTOM_CONFIG_NOT_READY, "config not ready"); warning(CUSTOM_CONFIG_NOT_READY, "config not ready");
return 0; // we can end up here during configuration reset return 0; // we can end up here during configuration reset
} }
if (isCranking) { if (isCranking) {
theoreticalInjectionLength = getCrankingFuel(PASS_ENGINE_PARAMETER_SIGNATURE) / numberOfCylinders; theoreticalInjectionLength = getCrankingFuel(PASS_ENGINE_PARAMETER_SIGNATURE) / numberOfInjections;
efiAssert(!cisnan(theoreticalInjectionLength), "NaN cranking theoreticalInjectionLength", 0); efiAssert(!cisnan(theoreticalInjectionLength), "NaN cranking theoreticalInjectionLength", 0);
} else { } else {
floatms_t baseFuel = getBaseFuel(rpm PASS_ENGINE_PARAMETER_SUFFIX); floatms_t baseFuel = getBaseFuel(rpm PASS_ENGINE_PARAMETER_SUFFIX);
floatms_t fuelPerCycle = getRunningFuel(baseFuel PASS_ENGINE_PARAMETER_SUFFIX); floatms_t fuelPerCycle = getRunningFuel(baseFuel PASS_ENGINE_PARAMETER_SUFFIX);
theoreticalInjectionLength = fuelPerCycle / numberOfCylinders; theoreticalInjectionLength = fuelPerCycle / numberOfInjections;
efiAssert(!cisnan(theoreticalInjectionLength), "NaN fuelPerCycle", 0); efiAssert(!cisnan(theoreticalInjectionLength), "NaN fuelPerCycle", 0);
#if EFI_PRINTF_FUEL_DETAILS || defined(__DOXYGEN__) #if EFI_PRINTF_FUEL_DETAILS || defined(__DOXYGEN__)
printf("baseFuel=%f fuelPerCycle=%f theoreticalInjectionLength=%f\t\n", printf("baseFuel=%f fuelPerCycle=%f theoreticalInjectionLength=%f\t\n",