Performance improvement: call GetBaseFuel less (#979)
* Remove extra calls to getInjectionDuration * increase callback frequency
This commit is contained in:
parent
344136eea9
commit
95e51f1399
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue