rpm refactoring
This commit is contained in:
parent
b61a61d44f
commit
f8fb3cdb69
|
@ -101,7 +101,7 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
|
|||
|
||||
angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
angle_t angle;
|
||||
if (isCrankingR(rpm)) {
|
||||
if (ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||
angle = engineConfiguration->crankingTimingAngle;
|
||||
} else {
|
||||
if (CONFIG(timingMode) == TM_DYNAMIC) {
|
||||
|
|
|
@ -62,12 +62,12 @@ RpmCalculator::RpmCalculator() {
|
|||
oneDegreeUs = NAN;
|
||||
}
|
||||
|
||||
bool RpmCalculator::isStopped() {
|
||||
bool RpmCalculator::isStopped(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RpmCalculator::isCranking() {
|
||||
return false;
|
||||
bool RpmCalculator::isCranking(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return ((rpmValue) > 0 && (rpmValue) < CONFIG(cranking.rpm));
|
||||
}
|
||||
|
||||
//bool RpmCalculator::isRunning() {
|
||||
|
@ -80,8 +80,7 @@ bool RpmCalculator::isCranking() {
|
|||
bool RpmCalculator::isRunning(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
efitick_t nowNt = getTimeNowNt();
|
||||
if (ENGINE(stopEngineRequestTimeNt) != 0) {
|
||||
if (nowNt
|
||||
- ENGINE(stopEngineRequestTimeNt)< 3 * US2NT(US_PER_SECOND_LL)) {
|
||||
if (nowNt - ENGINE(stopEngineRequestTimeNt) < 3 * US2NT(US_PER_SECOND_LL)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,11 +57,11 @@ public:
|
|||
/**
|
||||
* Returns true if the engine is not spinning (RPM==0)
|
||||
*/
|
||||
bool isStopped();
|
||||
bool isStopped(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
/**
|
||||
* Returns true if the engine is cranking
|
||||
*/
|
||||
bool isCranking();
|
||||
bool isCranking(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
/**
|
||||
* Returns true if the engine is running and not cranking
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue