only: bugfix, allow engine stop without requireFootOnBrakeToCrank
This commit is contained in:
parent
e17f6fdd76
commit
e24ded6e41
|
@ -69,6 +69,7 @@ void slowStartStopButtonCallback() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (engine->rpmCalculator.isStopped()) {
|
||||||
if (engineConfiguration->requireFootOnBrakeToCrank && !engine->brakePedalSwitchedState) {
|
if (engineConfiguration->requireFootOnBrakeToCrank && !engine->brakePedalSwitchedState) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -76,12 +77,12 @@ void slowStartStopButtonCallback() {
|
||||||
if (isCrankingSuppressed()) {
|
if (isCrankingSuppressed()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool startStopState = engine->startStopState.startStopButtonDebounce.readPinEvent();
|
bool startStopState = engine->startStopState.startStopButtonDebounce.readPinEvent();
|
||||||
|
|
||||||
if (startStopState && !engine->engineState.startStopState) {
|
if (startStopState && !engine->engineState.startStopState) {
|
||||||
// we are here on transition from 0 to 1
|
// we are here on transition from 0 to 1
|
||||||
// TODO: huh? looks like 'stop engine' feature is broken?! we invoke 'toggle' method under "from off to on" condition?!
|
|
||||||
onStartStopButtonToggle();
|
onStartStopButtonToggle();
|
||||||
}
|
}
|
||||||
// todo: we shall extract start_stop.txt from engine_state.txt
|
// todo: we shall extract start_stop.txt from engine_state.txt
|
||||||
|
|
Loading…
Reference in New Issue