minor trigger refactoring
This commit is contained in:
parent
a0c234c76d
commit
e3fd84ed08
|
@ -313,11 +313,11 @@ void Engine::OnTriggerSynchronizationLost() {
|
|||
// Needed for early instant-RPM detection
|
||||
rpmCalculator.setStopSpinning();
|
||||
|
||||
triggerCentral.triggerState.resetTriggerState();
|
||||
triggerCentral.triggerState.resetState();
|
||||
|
||||
for (size_t i = 0; i < efi::size(triggerCentral.vvtState); i++) {
|
||||
for (size_t j = 0; j < efi::size(triggerCentral.vvtState[0]); j++) {
|
||||
triggerCentral.vvtState[i][j].resetTriggerState();
|
||||
triggerCentral.vvtState[i][j].resetState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ TriggerCentral::TriggerCentral() :
|
|||
triggerState("TRG")
|
||||
{
|
||||
memset(&hwEventCounters, 0, sizeof(hwEventCounters));
|
||||
triggerState.resetTriggerState();
|
||||
triggerState.resetState();
|
||||
noiseFilter.resetAccumSignalData();
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
TriggerDecoderBase::TriggerDecoderBase(const char* name)
|
||||
: name(name)
|
||||
{
|
||||
resetTriggerState();
|
||||
resetState();
|
||||
}
|
||||
|
||||
bool TriggerDecoderBase::getShaftSynchronized() {
|
||||
|
@ -77,7 +77,7 @@ void TriggerDecoderBase::setShaftSynchronized(bool value) {
|
|||
shaft_is_synchronized = value;
|
||||
}
|
||||
|
||||
void TriggerDecoderBase::resetTriggerState() {
|
||||
void TriggerDecoderBase::resetState() {
|
||||
setShaftSynchronized(false);
|
||||
toothed_previous_time = 0;
|
||||
|
||||
|
@ -195,8 +195,8 @@ int TriggerDecoderBase::getCrankSynchronizationCounter() const {
|
|||
return crankSynchronizationCounter;
|
||||
}
|
||||
|
||||
void PrimaryTriggerDecoder::resetTriggerState() {
|
||||
TriggerDecoderBase::resetTriggerState();
|
||||
void PrimaryTriggerDecoder::resetState() {
|
||||
TriggerDecoderBase::resetState();
|
||||
|
||||
prevInstantRpmValue = 0;
|
||||
m_instantRpm = 0;
|
||||
|
@ -831,7 +831,7 @@ uint32_t TriggerDecoderBase::findTriggerZeroEventIndex(
|
|||
#endif
|
||||
|
||||
|
||||
resetTriggerState();
|
||||
resetState();
|
||||
|
||||
if (shape.shapeDefinitionError) {
|
||||
return 0;
|
||||
|
|
|
@ -139,7 +139,7 @@ public:
|
|||
uint32_t totalTriggerErrorCounter;
|
||||
uint32_t orderingErrorCounter;
|
||||
|
||||
virtual void resetTriggerState();
|
||||
virtual void resetState();
|
||||
void setShaftSynchronized(bool value);
|
||||
bool getShaftSynchronized();
|
||||
|
||||
|
@ -188,7 +188,7 @@ private:
|
|||
class PrimaryTriggerDecoder : public TriggerDecoderBase, public trigger_state_primary_s {
|
||||
public:
|
||||
PrimaryTriggerDecoder(const char* name);
|
||||
void resetTriggerState() override;
|
||||
void resetState() override;
|
||||
|
||||
void resetHasFullSync() {
|
||||
// If this trigger doesn't need disambiguation, we already have phase sync
|
||||
|
|
Loading…
Reference in New Issue