RPM refactoring
This commit is contained in:
parent
e1e17bab2a
commit
73028851dd
|
@ -370,7 +370,7 @@ bool Engine::isInShutdownMode() {
|
|||
|
||||
injection_mode_e Engine::getCurrentInjectionMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
int rpm = rpmCalculator.rpmValue;
|
||||
return isCrankingR(rpm) ? CONFIG(crankingInjectionMode) : CONFIG(injectionMode);
|
||||
return rpmCalculator.isCranking(PASS_ENGINE_PARAMETER_SIGNATURE) ? CONFIG(crankingInjectionMode) : CONFIG(injectionMode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -132,7 +132,7 @@ percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|||
*/
|
||||
floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
float theoreticalInjectionLength;
|
||||
bool isCranking = isCrankingR(rpm);
|
||||
bool isCranking = ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
int numberOfCylinders = getNumberOfInjections(isCranking ?
|
||||
engineConfiguration->crankingInjectionMode :
|
||||
engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
|
|
@ -103,7 +103,7 @@ static msg_t csThread(void) {
|
|||
#if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__)
|
||||
while (true) {
|
||||
int rpm = getRpmE(engine);
|
||||
int is_cranking = isCrankingR(rpm);
|
||||
int is_cranking = ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
int is_running = rpm > 0 && !is_cranking;
|
||||
if (is_running) {
|
||||
// blinking while running
|
||||
|
|
|
@ -236,7 +236,7 @@ floatms_t getCrankingSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|||
*/
|
||||
floatms_t getSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
float dwellMs;
|
||||
if (isCrankingR(rpm)) {
|
||||
if (ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
dwellMs = getCrankingSparkDwell(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
} else {
|
||||
efiAssert(!cisnan(rpm), "invalid rpm", NAN);
|
||||
|
|
Loading…
Reference in New Issue