startStopStateToggleCounter to live data
This commit is contained in:
parent
aba1e34dcf
commit
5b8914b6d4
|
@ -229,10 +229,6 @@ public:
|
||||||
|
|
||||||
RpmCalculator rpmCalculator;
|
RpmCalculator rpmCalculator;
|
||||||
|
|
||||||
bool startStopState = false;
|
|
||||||
int startStopStateToggleCounter = 0;
|
|
||||||
|
|
||||||
|
|
||||||
Timer configBurnTimer;
|
Timer configBurnTimer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -37,7 +37,7 @@ void contextSwitchHook() {}
|
||||||
#endif /* ENABLE_PERF_TRACE */
|
#endif /* ENABLE_PERF_TRACE */
|
||||||
|
|
||||||
static void onStartStopButtonToggle() {
|
static void onStartStopButtonToggle() {
|
||||||
engine->startStopStateToggleCounter++;
|
engine->engineState.startStopStateToggleCounter++;
|
||||||
|
|
||||||
if (engine->rpmCalculator.isStopped()) {
|
if (engine->rpmCalculator.isStopped()) {
|
||||||
bool wasStarterEngaged = enginePins.starterControl.getAndSet(1);
|
bool wasStarterEngaged = enginePins.starterControl.getAndSet(1);
|
||||||
|
@ -57,11 +57,11 @@ static void onStartStopButtonToggle() {
|
||||||
void slowStartStopButtonCallback() {
|
void slowStartStopButtonCallback() {
|
||||||
bool startStopState = startStopButtonDebounce.readPinEvent();
|
bool startStopState = startStopButtonDebounce.readPinEvent();
|
||||||
|
|
||||||
if (startStopState && !engine->startStopState) {
|
if (startStopState && !engine->engineState.startStopState) {
|
||||||
// we are here on transition from 0 to 1
|
// we are here on transition from 0 to 1
|
||||||
onStartStopButtonToggle();
|
onStartStopButtonToggle();
|
||||||
}
|
}
|
||||||
engine->startStopState = startStopState;
|
engine->engineState.startStopState = startStopState;
|
||||||
|
|
||||||
if (engine->startStopStateLastPushTime == 0) {
|
if (engine->startStopStateLastPushTime == 0) {
|
||||||
// nothing is going on with startStop button
|
// nothing is going on with startStop button
|
||||||
|
|
Loading…
Reference in New Issue