refactoring: extract method
This commit is contained in:
parent
befb1a5830
commit
43df4f83c6
|
@ -266,7 +266,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PAR
|
||||||
* We are here if there is a time gap between now and previous shaft event - that means the engine is not runnig.
|
* We are here if there is a time gap between now and previous shaft event - that means the engine is not runnig.
|
||||||
* That means we have lost synchronization since the engine is not running :)
|
* That means we have lost synchronization since the engine is not running :)
|
||||||
*/
|
*/
|
||||||
triggerState.shaft_is_synchronized = false;
|
triggerState.onSynchronizationLost(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
}
|
}
|
||||||
previousShaftEventTimeNt = nowNt;
|
previousShaftEventTimeNt = nowNt;
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,10 @@ void TriggerState::resetCurrentCycleState() {
|
||||||
currentCycle.current_index = 0;
|
currentCycle.current_index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TriggerState::onSynchronizationLost(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
shaft_is_synchronized = false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Trigger decoding happens here
|
* @brief Trigger decoding happens here
|
||||||
* This method is invoked every time we have a fall or rise on one of the trigger sensors.
|
* This method is invoked every time we have a fall or rise on one of the trigger sensors.
|
||||||
|
|
|
@ -60,6 +60,10 @@ public:
|
||||||
efitime_t getTotalEventCounter();
|
efitime_t getTotalEventCounter();
|
||||||
efitime_t getStartOfRevolutionIndex();
|
efitime_t getStartOfRevolutionIndex();
|
||||||
void decodeTriggerEvent(trigger_event_e const signal, efitime_t nowUs DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void decodeTriggerEvent(trigger_event_e const signal, efitime_t nowUs DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
/**
|
||||||
|
* Resets synchronization flag and alerts rpm_calculator to reset engine spinning flag.
|
||||||
|
*/
|
||||||
|
void onSynchronizationLost(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
bool isValidIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
bool isValidIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
float getTriggerDutyCycle(int index);
|
float getTriggerDutyCycle(int index);
|
||||||
|
|
Loading…
Reference in New Issue