This commit is contained in:
rusefi 2018-02-06 01:29:16 +03:00
parent e21cd71e4b
commit 1748f4e064
2 changed files with 16 additions and 15 deletions

View File

@ -151,6 +151,22 @@ void TriggerState::reset() {
int TriggerState::getCurrentIndex() {
return currentCycle.current_index;
}
void TriggerState::incrementTotalEventCounter() {
totalRevolutionCounter++;
}
bool TriggerState::isEvenRevolution() {
return totalRevolutionCounter & 1;
}
void TriggerState::resetCurrentCycleState() {
memset(currentCycle.eventCount, 0, sizeof(currentCycle.eventCount));
memset(currentCycle.timeOfPreviousEventNt, 0, sizeof(currentCycle.timeOfPreviousEventNt));
memset(currentCycle.totalTimeNt, 0, sizeof(currentCycle.totalTimeNt));
currentCycle.current_index = 0;
}
/**
* @brief Trigger decoding happens here
* This method is invoked every time we have a fall or rise on one of the trigger sensors.

View File

@ -239,21 +239,6 @@ int TriggerState::getTotalRevolutionCounter() {
}
void TriggerState::incrementTotalEventCounter() {
totalRevolutionCounter++;
}
bool TriggerState::isEvenRevolution() {
return totalRevolutionCounter & 1;
}
void TriggerState::resetCurrentCycleState() {
memset(currentCycle.eventCount, 0, sizeof(currentCycle.eventCount));
memset(currentCycle.timeOfPreviousEventNt, 0, sizeof(currentCycle.timeOfPreviousEventNt));
memset(currentCycle.totalTimeNt, 0, sizeof(currentCycle.totalTimeNt));
currentCycle.current_index = 0;
}
/**
* physical primary trigger duration
*/