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