From 32c1cd09da025bb7a208d9a7bab646d0f4e9e0b4 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Mon, 24 Jan 2022 20:58:21 -0500 Subject: [PATCH] https://www.rusefi.com/forum/viewtopic.php?p=44166#p44166 launch control live data --- firmware/controllers/algo/launch_control.cpp | 13 +++++++------ firmware/controllers/algo/launch_control_state.txt | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/firmware/controllers/algo/launch_control.cpp b/firmware/controllers/algo/launch_control.cpp index cfa00b5c0b..c0fbe47e5c 100644 --- a/firmware/controllers/algo/launch_control.cpp +++ b/firmware/controllers/algo/launch_control.cpp @@ -21,8 +21,11 @@ * In case we are dependent on VSS we just return true. */ bool LaunchControlBase::isInsideSwitchCondition() { - switch (engineConfiguration->launchActivationMode) { - case SWITCH_INPUT_LAUNCH: + isSwitchActivated = engineConfiguration->launchActivationMode == SWITCH_INPUT_LAUNCH; + isClutchActivated = engineConfiguration->launchActivationMode == CLUTCH_INPUT_LAUNCH; + + + if (isSwitchActivated) { #if !EFI_SIMULATOR if (isBrainPinValid(engineConfiguration->launchActivatePin)) { //todo: we should take into consideration if this sw is pulled high or low! @@ -30,15 +33,13 @@ bool LaunchControlBase::isInsideSwitchCondition() { } #endif // EFI_PROD_CODE return launchActivatePinState; - - case CLUTCH_INPUT_LAUNCH: + } else if (isClutchActivated) { if (isBrainPinValid(engineConfiguration->clutchDownPin)) { return engine->clutchDownState; } else { return false; } - - default: + } else { // ALWAYS_ACTIVE_LAUNCH return true; } diff --git a/firmware/controllers/algo/launch_control_state.txt b/firmware/controllers/algo/launch_control_state.txt index dc7a35a4e6..c6d666ddc0 100644 --- a/firmware/controllers/algo/launch_control_state.txt +++ b/firmware/controllers/algo/launch_control_state.txt @@ -7,6 +7,7 @@ bit launchActivatePinState bit isLaunchCondition bit isSwitchActivated bit isClutchActivated +bit isValidInputPin bit activateSwitchCondition; bit rpmCondition;