From 1748f4e0641b1de7daf29fdfaa620a7140d069fb Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 6 Feb 2018 01:29:16 +0300 Subject: [PATCH] location --- firmware/controllers/trigger/trigger_decoder.cpp | 16 ++++++++++++++++ .../controllers/trigger/trigger_structure.cpp | 15 --------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index cdbc243532..a71aa26164 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -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. diff --git a/firmware/controllers/trigger/trigger_structure.cpp b/firmware/controllers/trigger/trigger_structure.cpp index dfde8943c4..1c0f230617 100644 --- a/firmware/controllers/trigger/trigger_structure.cpp +++ b/firmware/controllers/trigger/trigger_structure.cpp @@ -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 */