Starter seems to be engaged forever #1965

This commit is contained in:
rusefillc 2020-11-18 21:08:01 -05:00
parent 7f688f7616
commit ce202c7ed7
1 changed files with 4 additions and 5 deletions

View File

@ -141,24 +141,24 @@ etitick_t getTimeNowNt() {
}
*/
#endif /* EFI_PROD_CODE */
static void onStartStopButtonToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engine->startStopStateToggleCounter++;
if (engine->rpmCalculator.isStopped(PASS_ENGINE_PARAMETER_SIGNATURE)) {
if (engine->rpmCalculator.isStopped()) {
bool wasStarterEngaged = enginePins.starterControl.getAndSet(1);
if (!wasStarterEngaged) {
scheduleMsg(&sharedLogger, "Let's crank this engine for up to %dseconds!", CONFIG(startCrankingDuration));
}
} else if (engine->rpmCalculator.isRunning()) {
scheduleMsg(&sharedLogger, "Let's stop this engine!");
scheduleStopEngine();
doScheduleStopEngine(PASS_ENGINE_PARAMETER_SIGNATURE);
}
}
#endif /* EFI_PROD_CODE */
void slowStartStopButtonCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
#if EFI_PROD_CODE
bool startStopState = startStopButtonDebounce.readPinEvent();
if (startStopState && !engine->startStopState) {
@ -166,7 +166,6 @@ void slowStartStopButtonCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
onStartStopButtonToggle(PASS_ENGINE_PARAMETER_SIGNATURE);
}
engine->startStopState = startStopState;
#endif /* EFI_PROD_CODE */
// todo: should this be simply FSIO?
if (engine->rpmCalculator.isRunning()) {