trigger code minor clean-up
This commit is contained in:
parent
f7a2cc9e63
commit
87930e3b49
|
@ -219,7 +219,6 @@ int TriggerCentral::getHwEventCounter(int index) {
|
|||
|
||||
void TriggerCentral::resetCounters() {
|
||||
memset(hwEventCounters, 0, sizeof(hwEventCounters));
|
||||
triggerState.resetRunningCounters();
|
||||
}
|
||||
|
||||
void TriggerCentral::resetAccumSignalData() {
|
||||
|
|
|
@ -116,7 +116,7 @@ void calculateTriggerSynchPoint(TriggerShape *shape, TriggerState *state DECLARE
|
|||
}
|
||||
}
|
||||
|
||||
efitime_t TriggerState::getTotalEventCounter() {
|
||||
efitime_t TriggerState::getTotalEventCounter() const {
|
||||
return totalEventCountBase + currentCycle.current_index;
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,6 @@ void TriggerState::resetTriggerState() {
|
|||
prevSignal = SHAFT_PRIMARY_FALLING;
|
||||
startOfCycleNt = 0;
|
||||
|
||||
resetRunningCounters();
|
||||
resetCurrentCycleState();
|
||||
memset(expectedTotalTime, 0, sizeof(expectedTotalTime));
|
||||
|
||||
|
@ -544,7 +543,6 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
|
|||
startOfCycleNt = nowNt;
|
||||
resetCurrentCycleState();
|
||||
incrementTotalEventCounter();
|
||||
runningRevolutionCounter++;
|
||||
totalEventCountBase += getTriggerSize();
|
||||
|
||||
|
||||
|
@ -552,7 +550,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
|
|||
if (printTriggerDebug) {
|
||||
printf("index=%d %d\r\n",
|
||||
currentCycle.current_index,
|
||||
runningRevolutionCounter);
|
||||
totalRevolutionCounter);
|
||||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
} else { /* if (!isSynchronizationPoint) */
|
||||
|
@ -651,16 +649,10 @@ void initTriggerDecoderLogger(Logging *sharedLogger) {
|
|||
logger = sharedLogger;
|
||||
}
|
||||
|
||||
efitime_t TriggerState::getStartOfRevolutionIndex() {
|
||||
efitime_t TriggerState::getStartOfRevolutionIndex() const {
|
||||
return totalEventCountBase;
|
||||
}
|
||||
|
||||
void TriggerState::resetRunningCounters() {
|
||||
runningRevolutionCounter = 0;
|
||||
runningTriggerErrorCounter = 0;
|
||||
runningOrderingErrorCounter = 0;
|
||||
}
|
||||
|
||||
void TriggerState::runtimeStatistics(efitime_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
// empty base implementation
|
||||
}
|
||||
|
|
|
@ -57,8 +57,8 @@ public:
|
|||
*/
|
||||
bool isEvenRevolution() const;
|
||||
void incrementTotalEventCounter();
|
||||
efitime_t getTotalEventCounter();
|
||||
efitime_t getStartOfRevolutionIndex();
|
||||
efitime_t getTotalEventCounter() const;
|
||||
efitime_t getStartOfRevolutionIndex() const;
|
||||
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.
|
||||
|
@ -93,16 +93,12 @@ public:
|
|||
* how many times since ECU reboot we had unexpected number of teeth in trigger cycle
|
||||
*/
|
||||
uint32_t totalTriggerErrorCounter;
|
||||
uint32_t runningTriggerErrorCounter;
|
||||
uint32_t orderingErrorCounter;
|
||||
uint32_t runningOrderingErrorCounter;
|
||||
|
||||
void resetTriggerState();
|
||||
void resetRunningCounters();
|
||||
|
||||
virtual void runtimeStatistics(efitime_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
uint32_t runningRevolutionCounter;
|
||||
/**
|
||||
* this is start of real trigger cycle
|
||||
* for virtual double trigger see timeAtVirtualZeroNt
|
||||
|
|
Loading…
Reference in New Issue