only:requireFootOnBrakeToCrank and isCrankingSuppressed

This commit is contained in:
Andrey 2024-05-19 01:02:09 -04:00
parent 14f57d9b5a
commit 9d8c4f195c
1 changed files with 12 additions and 0 deletions

View File

@ -49,6 +49,10 @@ static void disengageStarterIfNeeded() {
}
}
PUBLIC_API_WEAK bool isCrankingSuppressed() {
return false;
}
void slowStartStopButtonCallback() {
if (!isIgnVoltage()) {
// nothing to crank if we are powered only via USB
@ -65,6 +69,14 @@ void slowStartStopButtonCallback() {
return;
}
if (engineConfiguration->requireFootOnBrakeToCrank && !engine->brakePedalSwitchedState) {
return;
}
if (isCrankingSuppressed()) {
return;
}
bool startStopState = engine->startStopState.startStopButtonDebounce.readPinEvent();
if (startStopState && !engine->engineState.startStopState) {