diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index c318de6586..25d266003d 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -229,10 +229,6 @@ public: RpmCalculator rpmCalculator; - bool startStopState = false; - int startStopStateToggleCounter = 0; - - Timer configBurnTimer; /** diff --git a/firmware/controllers/engine_controller_misc.cpp b/firmware/controllers/engine_controller_misc.cpp index b9d145f92f..ea80a45481 100644 --- a/firmware/controllers/engine_controller_misc.cpp +++ b/firmware/controllers/engine_controller_misc.cpp @@ -37,7 +37,7 @@ void contextSwitchHook() {} #endif /* ENABLE_PERF_TRACE */ static void onStartStopButtonToggle() { - engine->startStopStateToggleCounter++; + engine->engineState.startStopStateToggleCounter++; if (engine->rpmCalculator.isStopped()) { bool wasStarterEngaged = enginePins.starterControl.getAndSet(1); @@ -57,11 +57,11 @@ static void onStartStopButtonToggle() { void slowStartStopButtonCallback() { bool startStopState = startStopButtonDebounce.readPinEvent(); - if (startStopState && !engine->startStopState) { + if (startStopState && !engine->engineState.startStopState) { // we are here on transition from 0 to 1 onStartStopButtonToggle(); } - engine->startStopState = startStopState; + engine->engineState.startStopState = startStopState; if (engine->startStopStateLastPushTime == 0) { // nothing is going on with startStop button