Revert "Revert "Performance improvement: call GetBaseFuel less (#979)""

This reverts commit 323904728d.
This commit is contained in:
rusefi 2019-10-16 23:02:24 -04:00
parent 323904728d
commit 7d73334b54
4 changed files with 3 additions and 13 deletions

View File

@ -368,13 +368,9 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engine->m.beforeFuelCalc = getTimeNowLowerNt();
int rpm = GET_RPM();
/**
* we have same assignment of 'getInjectionDuration' to 'injectionDuration' in handleFuel()
* Open question why do we refresh that in two places?
*/
ENGINE(injectionDuration) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
engine->m.fuelCalcTime = getTimeNowLowerNt() - engine->m.beforeFuelCalc;
}
void doScheduleStopEngine(DECLARE_ENGINE_PARAMETER_SIGNATURE) {

View File

@ -29,7 +29,7 @@
#include "global_execution_queue.h"
#endif /* EFI_UNIT_TEST */
#define FAST_CALLBACK_PERIOD_MS 20
#define FAST_CALLBACK_PERIOD_MS 5
class RpmCalculator;

View File

@ -220,7 +220,7 @@ int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX)
* @see getCoilDutyCycle
*/
percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
floatms_t totalInjectiorAmountPerCycle = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX);
floatms_t totalInjectiorAmountPerCycle = ENGINE(injectionDuration) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX);
floatms_t engineCycleDuration = getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
return 100 * totalInjectiorAmountPerCycle / engineCycleDuration;
}

View File

@ -389,12 +389,6 @@ static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIn
ENGINE(engineLoadAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_SIGNATURE));
}
/**
* we have same assignment of 'getInjectionDuration' to 'injectionDuration' in periodicFastCallback()
* Open question why do we refresh that in two places?
*/
ENGINE(injectionDuration) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
for (int injEventIndex = 0; injEventIndex < CONFIG(specs.cylindersCount); injEventIndex++) {
InjectionEvent *event = &fs->elements[injEventIndex];
uint32_t eventIndex = event->injectionStart.triggerEventIndex;