only:secondsSinceIgnVoltage API

This commit is contained in:
rusefillc 2024-11-08 15:31:27 -05:00
parent c3d2cfc33c
commit 3b1316f622
2 changed files with 5 additions and 1 deletions

View File

@ -20,7 +20,7 @@ void IgnitionController::onSlowCallback() {
// Ignore low voltage transients - we may see this at the start of cranking
// and we don't want to
if (!hasIgnVoltage && !m_timeSinceIgnVoltage.hasElapsedSec(0.2f)) {
if (!hasIgnVoltage && secondsSinceIgnVoltage() < 0.2f) {
return;
}

View File

@ -16,6 +16,10 @@ public:
return m_lastState;
}
float secondsSinceIgnVoltage() {
return m_timeSinceIgnVoltage.getElapsedSeconds();
}
private:
Timer m_timeSinceIgnVoltage;
bool m_lastState = false;