mirror of https://github.com/rusefi/rusefi.git
parent
84bd6dc277
commit
0d43df3aec
|
@ -40,6 +40,7 @@ struct_no_prefix engine_state_s
|
|||
int8_t startStopState
|
||||
bit startStopPhysicalState
|
||||
uint32_t startStopStateToggleCounter
|
||||
uint32_t startStopStateTempPhysicalCounter
|
||||
|
||||
float egtValue1
|
||||
float egtValue2
|
||||
|
|
|
@ -47,6 +47,9 @@ static void disengageStarterIfNeeded() {
|
|||
}
|
||||
}
|
||||
|
||||
static int prevPhysicalState = 0;
|
||||
static int currentPhysicalState = 0;
|
||||
|
||||
void slowStartStopButtonCallback() {
|
||||
if (getTimeNowMs() < engineConfiguration->startButtonSuppressOnStartUpMs) {
|
||||
// where are odd cases of start button combined with ECU power source button we do not want to crank right on start
|
||||
|
@ -62,6 +65,11 @@ void slowStartStopButtonCallback() {
|
|||
}
|
||||
engine->engineState.startStopState = startStopState;
|
||||
engine->engineState.startStopPhysicalState = startStopButtonDebounce.getPhysicalState();
|
||||
currentPhysicalState = startStopButtonDebounce.getPhysicalState();
|
||||
if (currentPhysicalState != prevPhysicalState) {
|
||||
engine->engineState.startStopStateTempPhysicalCounter++;
|
||||
}
|
||||
prevPhysicalState = currentPhysicalState;
|
||||
|
||||
bool isStarterEngaged = enginePins.starterControl.getLogicValue();
|
||||
|
||||
|
|
Loading…
Reference in New Issue