only:secondsSinceIgnVoltage API
This commit is contained in:
parent
c3d2cfc33c
commit
3b1316f622
|
@ -20,7 +20,7 @@ void IgnitionController::onSlowCallback() {
|
||||||
|
|
||||||
// Ignore low voltage transients - we may see this at the start of cranking
|
// Ignore low voltage transients - we may see this at the start of cranking
|
||||||
// and we don't want to
|
// and we don't want to
|
||||||
if (!hasIgnVoltage && !m_timeSinceIgnVoltage.hasElapsedSec(0.2f)) {
|
if (!hasIgnVoltage && secondsSinceIgnVoltage() < 0.2f) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,10 @@ public:
|
||||||
return m_lastState;
|
return m_lastState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float secondsSinceIgnVoltage() {
|
||||||
|
return m_timeSinceIgnVoltage.getElapsedSeconds();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Timer m_timeSinceIgnVoltage;
|
Timer m_timeSinceIgnVoltage;
|
||||||
bool m_lastState = false;
|
bool m_lastState = false;
|
||||||
|
|
Loading…
Reference in New Issue