mirror of https://github.com/rusefi/rusefi.git
launch control: Speed threshold depends on launch mode, also zero speed limit handling #5419
only: change zero setting handling
This commit is contained in:
parent
3c090129e6
commit
dabae98f16
|
@ -45,12 +45,13 @@ bool LaunchControlBase::isInsideSwitchCondition() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns True in case Vehicle speed is less then threshold.
|
* Returns True when Vehicle speed ALLOWS launch control
|
||||||
* 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!
|
|
||||||
*/
|
*/
|
||||||
bool LaunchControlBase::isInsideSpeedCondition() const {
|
bool LaunchControlBase::isInsideSpeedCondition() const {
|
||||||
|
if (engineConfiguration->launchSpeedThreshold == 0) {
|
||||||
|
return true; // allow launch, speed does not matter
|
||||||
|
}
|
||||||
|
|
||||||
int speed = Sensor::getOrZero(SensorType::VehicleSpeed);
|
int speed = Sensor::getOrZero(SensorType::VehicleSpeed);
|
||||||
|
|
||||||
return (engineConfiguration->launchSpeedThreshold > speed) || (!(engineConfiguration->launchActivationMode == ALWAYS_ACTIVE_LAUNCH));
|
return (engineConfiguration->launchSpeedThreshold > speed) || (!(engineConfiguration->launchActivationMode == ALWAYS_ACTIVE_LAUNCH));
|
||||||
|
|
|
@ -875,7 +875,7 @@ custom maf_sensor_type_e 1 bits, S08, @OFFSET@, [0:1], @@maf_sensor_type_e_enum@
|
||||||
bit multisparkEnable
|
bit multisparkEnable
|
||||||
bit enableLaunchRetard
|
bit enableLaunchRetard
|
||||||
bit unfinishedenableLaunchBoost
|
bit unfinishedenableLaunchBoost
|
||||||
bit unfinishedlaunchDisableBySpeed
|
bit unusedBitLDBS
|
||||||
bit enableCanVss;Read VSS from OEM CAN bus according to selected CAN vehicle configuration.
|
bit enableCanVss;Read VSS from OEM CAN bus according to selected CAN vehicle configuration.
|
||||||
bit enableInnovateLC2
|
bit enableInnovateLC2
|
||||||
bit showHumanReadableWarning
|
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@@
|
custom antiLagActivationMode_e 1 bits, S08, @OFFSET@, [0:0], @@antiLagActivationMode_e_enum@@
|
||||||
antiLagActivationMode_e antiLagActivationMode;
|
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 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 launchFuelAdded;Extra Fuel Added;"%", 1, 0, 0, 100, 0
|
||||||
int launchBoostDuty;Duty Cycle for the Boost Solenoid;"%", 1, 0, 0, 100, 0
|
int launchBoostDuty;Duty Cycle for the Boost Solenoid;"%", 1, 0, 0, 100, 0
|
||||||
|
|
|
@ -40,7 +40,6 @@ TEST(LaunchControl, VSSCondition) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST(LaunchControl, ZeroVSSCondition) {
|
TEST(LaunchControl, ZeroVSSCondition) {
|
||||||
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
||||||
|
|
||||||
|
@ -51,8 +50,7 @@ TEST(LaunchControl, ZeroVSSCondition) {
|
||||||
engineConfiguration->launchSpeedThreshold = 0;
|
engineConfiguration->launchSpeedThreshold = 0;
|
||||||
|
|
||||||
Sensor::setMockValue(SensorType::VehicleSpeed, 10.0);
|
Sensor::setMockValue(SensorType::VehicleSpeed, 10.0);
|
||||||
EXPECT_FALSE(dut.isInsideSpeedCondition());
|
EXPECT_TRUE(dut.isInsideSpeedCondition());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(LaunchControl, VSSConditionWithSwitch) {
|
TEST(LaunchControl, VSSConditionWithSwitch) {
|
||||||
|
|
Loading…
Reference in New Issue