diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index eb6c205e5c..415326dfaa 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -467,7 +467,6 @@ void Engine::periodicFastCallback() { engineState.periodicFastCallback(); - tachUpdate(); speedoUpdate(); engineModules.apply_all([](auto & m) { m.onFastCallback(); }); diff --git a/firmware/controllers/modules/tachometer/tachometer.cpp b/firmware/controllers/modules/tachometer/tachometer.cpp index de0b42b059..43aa4be559 100644 --- a/firmware/controllers/modules/tachometer/tachometer.cpp +++ b/firmware/controllers/modules/tachometer/tachometer.cpp @@ -11,8 +11,8 @@ #include "pch.h" static SimplePwm tachControl("tach"); -static float tachFreq; -static float duty; +static float tachFreq; +static float duty; #if EFI_UNIT_TEST float getTachFreq() { @@ -26,7 +26,7 @@ float getTachDuty() { static bool tachHasInit = false; -void tachUpdate() { +void TachometerModule::onFastCallback() { // Only do anything if tach enabled if (!tachHasInit) { return; diff --git a/firmware/controllers/modules/tachometer/tachometer.h b/firmware/controllers/modules/tachometer/tachometer.h index 5810b5cbcc..e96be542ed 100644 --- a/firmware/controllers/modules/tachometer/tachometer.h +++ b/firmware/controllers/modules/tachometer/tachometer.h @@ -8,7 +8,9 @@ #pragma once void initTachometer(); -void tachUpdate(); -// TODO -struct TachometerModule : public EngineModule { }; +struct TachometerModule : public EngineModule { + + // TODO: can/should this be slow callback instead? + void onFastCallback() override; +};