startStopStateToggleCounter to live data

This commit is contained in:
rusefillc 2022-10-06 22:21:02 -04:00
parent 920d4368d5
commit ba73aff1fa
2 changed files with 3 additions and 7 deletions

View File

@ -229,10 +229,6 @@ public:
RpmCalculator rpmCalculator;
bool startStopState = false;
int startStopStateToggleCounter = 0;
Timer configBurnTimer;
/**

View File

@ -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