refactoring #370
This commit is contained in:
parent
1810902352
commit
60920bfa14
|
@ -116,7 +116,7 @@ int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_S) {
|
|||
*/
|
||||
percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
floatms_t totalPerCycle = getInjectionDuration(rpm PASS_ENGINE_PARAMETER) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER);
|
||||
floatms_t engineCycleDuration = getCrankshaftRevolutionTimeMs(rpm) * (engineConfiguration->operationMode == TWO_STROKE ? 1 : 2);
|
||||
floatms_t engineCycleDuration = getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER);
|
||||
return 100 * totalPerCycle / engineCycleDuration;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,11 @@ EXTERN_ENGINE
|
|||
|
||||
extern EnginePins enginePins;
|
||||
|
||||
floatms_t getEngineCycleDuration(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
return getCrankshaftRevolutionTimeMs(rpm) * (engineConfiguration->operationMode == TWO_STROKE ? 1 : 2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return number of milliseconds in one crank shaft revolution
|
||||
*/
|
||||
|
|
|
@ -61,6 +61,7 @@ void setInjectorLag(float value DECLARE_ENGINE_PARAMETER_S);
|
|||
#define getOneDegreeTimeNt(rpm) (US2NT(1000000) * 60.0f / 360 / (rpm))
|
||||
|
||||
floatms_t getCrankshaftRevolutionTimeMs(int rpm);
|
||||
floatms_t getEngineCycleDuration(int rpm DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
#define isCrankingR(rpm) ((rpm) > 0 && (rpm) < CONFIG(cranking.rpm))
|
||||
|
||||
|
|
Loading…
Reference in New Issue