Starter is engaged on start-up in pull-up configuration #1969

usability & test improvement
This commit is contained in:
rusefillc 2020-11-19 17:15:28 -05:00
parent ee51da64ad
commit 68c8d8c6a2
2 changed files with 9 additions and 1 deletions

View File

@ -150,7 +150,9 @@ static void onStartStopButtonToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
bool wasStarterEngaged = enginePins.starterControl.getAndSet(1);
if (!wasStarterEngaged) {
engine->startStopStateLastPushTime = getTimeNowNt();
scheduleMsg(&sharedLogger, "Let's crank this engine for up to %dseconds!", CONFIG(startCrankingDuration));
scheduleMsg(&sharedLogger, "Let's crank this engine for up to %d seconds via %s!",
CONFIG(startCrankingDuration),
hwPortname(CONFIG(starterControlPin)));
}
} else if (engine->rpmCalculator.isRunning()) {
scheduleMsg(&sharedLogger, "Let's stop this engine!");

View File

@ -20,6 +20,12 @@ TEST(start, startStop) {
slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
ASSERT_FALSE(efiReadPin(engineConfiguration->starterControlPin));
// startup 'timeout' duration of time is a special case so let's sleep a bit
eth.smartMoveTimeForwardSeconds(10);
slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
ASSERT_FALSE(efiReadPin(engineConfiguration->starterControlPin));
eth.smartMoveTimeForwardSeconds(10);
// hit 'start' button! inverted since pull-up