diff --git a/firmware/controllers/ignition_controller.cpp b/firmware/controllers/ignition_controller.cpp index 6d385dc4fe..1c4967afd9 100644 --- a/firmware/controllers/ignition_controller.cpp +++ b/firmware/controllers/ignition_controller.cpp @@ -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; } diff --git a/firmware/controllers/ignition_controller.h b/firmware/controllers/ignition_controller.h index 64e31144c8..acbfaa8b76 100644 --- a/firmware/controllers/ignition_controller.h +++ b/firmware/controllers/ignition_controller.h @@ -16,6 +16,10 @@ public: return m_lastState; } + float secondsSinceIgnVoltage() { + return m_timeSinceIgnVoltage.getElapsedSeconds(); + } + private: Timer m_timeSinceIgnVoltage; bool m_lastState = false;