parent
2e89cca180
commit
d5e131b1d0
|
@ -82,6 +82,7 @@ void TriggerState::resetTriggerState() {
|
|||
isFirstEvent = true;
|
||||
|
||||
m_hasSynchronizedPhase = false;
|
||||
synchronizedPhase.init();
|
||||
}
|
||||
|
||||
void TriggerState::setTriggerErrorState() {
|
||||
|
|
|
@ -2,10 +2,18 @@
|
|||
|
||||
#include "timer.h"
|
||||
|
||||
Timer::Timer() {
|
||||
init();
|
||||
}
|
||||
|
||||
void Timer::reset() {
|
||||
m_lastReset = getTimeNowNt();
|
||||
}
|
||||
|
||||
void Timer::init() {
|
||||
m_lastReset = INT64_MIN / 8;
|
||||
}
|
||||
|
||||
void Timer::reset(efitick_t nowNt) {
|
||||
m_lastReset = nowNt;
|
||||
}
|
||||
|
|
|
@ -8,10 +8,13 @@
|
|||
*/
|
||||
class Timer {
|
||||
public:
|
||||
Timer();
|
||||
void reset();
|
||||
|
||||
// Reset the timer to a known timestamp (don't take a timestamp internally)
|
||||
void reset(efitick_t nowNt);
|
||||
// returns timer to the most original-as-constructed state
|
||||
void init();
|
||||
|
||||
bool hasElapsedSec(float seconds) const;
|
||||
bool hasElapsedMs(float ms) const;
|
||||
|
@ -32,5 +35,5 @@ public:
|
|||
|
||||
private:
|
||||
// Use not-quite-minimum value to avoid overflow
|
||||
efitick_t m_lastReset = INT64_MIN / 8;
|
||||
efitick_t m_lastReset;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue