diff --git a/firmware/controllers/algo/launch_control.cpp b/firmware/controllers/algo/launch_control.cpp index 6647ae551b..1c9a8818bc 100644 --- a/firmware/controllers/algo/launch_control.cpp +++ b/firmware/controllers/algo/launch_control.cpp @@ -45,12 +45,13 @@ bool LaunchControlBase::isInsideSwitchCondition() { } /** - * Returns True in case Vehicle speed is less then threshold. - * This condition would only return true based on speed if DisablebySpeed is true - * The condition logic is written in that way, that if we do not use disable by speed - * then we have to return true, and trust that we would disable by other condition! + * Returns True when Vehicle speed ALLOWS launch control */ bool LaunchControlBase::isInsideSpeedCondition() const { + if (engineConfiguration->launchSpeedThreshold == 0) { + return true; // allow launch, speed does not matter + } + int speed = Sensor::getOrZero(SensorType::VehicleSpeed); return (engineConfiguration->launchSpeedThreshold > speed) || (!(engineConfiguration->launchActivationMode == ALWAYS_ACTIVE_LAUNCH)); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 0f1e3490b0..ba538285e3 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -875,7 +875,7 @@ custom maf_sensor_type_e 1 bits, S08, @OFFSET@, [0:1], @@maf_sensor_type_e_enum@ bit multisparkEnable bit enableLaunchRetard bit unfinishedenableLaunchBoost - bit unfinishedlaunchDisableBySpeed + bit unusedBitLDBS bit enableCanVss;Read VSS from OEM CAN bus according to selected CAN vehicle configuration. bit enableInnovateLC2 bit showHumanReadableWarning @@ -924,7 +924,7 @@ bit verboseCan2,"Print all","Do not print";Print incoming and outgoing second bu custom antiLagActivationMode_e 1 bits, S08, @OFFSET@, [0:0], @@antiLagActivationMode_e_enum@@ antiLagActivationMode_e antiLagActivationMode; - int launchSpeedThreshold;Disabled above this speed;"Kph", 1, 0, 0, 300, 0 + int launchSpeedThreshold;Launch disabled above this speed if setting is above zero;"Kph", 1, 0, 0, 300, 0 int launchTimingRpmRange;Range from Launch RPM for Timing Retard to activate;"RPM", 1, 0, 0, 8000, 0 int launchFuelAdded;Extra Fuel Added;"%", 1, 0, 0, 100, 0 int launchBoostDuty;Duty Cycle for the Boost Solenoid;"%", 1, 0, 0, 100, 0 diff --git a/unit_tests/tests/test_launch.cpp b/unit_tests/tests/test_launch.cpp index 41b96c023a..54782bc4d6 100644 --- a/unit_tests/tests/test_launch.cpp +++ b/unit_tests/tests/test_launch.cpp @@ -40,7 +40,6 @@ TEST(LaunchControl, VSSCondition) { } - TEST(LaunchControl, ZeroVSSCondition) { EngineTestHelper eth(engine_type_e::TEST_ENGINE); @@ -51,8 +50,7 @@ TEST(LaunchControl, ZeroVSSCondition) { engineConfiguration->launchSpeedThreshold = 0; Sensor::setMockValue(SensorType::VehicleSpeed, 10.0); - EXPECT_FALSE(dut.isInsideSpeedCondition()); - + EXPECT_TRUE(dut.isInsideSpeedCondition()); } TEST(LaunchControl, VSSConditionWithSwitch) {