Add fuel adder to launch fix #4777

This commit is contained in:
rusefi 2022-11-13 20:23:19 -05:00
parent b60107a807
commit a17e12747e
4 changed files with 11 additions and 0 deletions

View File

@ -37,6 +37,7 @@ Release template (copy/paste this for new release):
- Lua: function to access VIN setting #3967
- Lua: designated Lua gauges with logging #4672
- GCC11 is the suggested compiler now, GCC9 no longer supported #4680
- Add fuel adder to launch #4777
### Fixed
- Fuel Priming reset fix #4627

View File

@ -129,6 +129,11 @@ float getRunningFuel(float baseFuel) {
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(postCrankingFuelCorrection), "NaN postCrankingFuelCorrection", 0);
float runningFuel = baseFuel * baroCorrection * iatCorrection * cltCorrection * postCrankingFuelCorrection;
#if EFI_LAUNCH_CONTROL
runningFuel *= engine->launchController.getFuelCoefficient();
#endif
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(runningFuel), "NaN runningFuel", 0);
engine->engineState.running.fuel = runningFuel * 1000;

View File

@ -94,6 +94,10 @@ LaunchControlBase::LaunchControlBase() {
isLaunchCondition = false;
}
bool LaunchControlBase::getFuelCoefficient() const {
return 1 + (isLaunchCondition && engineConfiguration->launchControlEnabled ? engineConfiguration->launchFuelAdderPercent / 100.0 : 0);
}
void LaunchControlBase::update() {
if (!engineConfiguration->launchControlEnabled) {
return;

View File

@ -18,6 +18,7 @@ public:
// Update the state of the launch control system
void update();
bool getFuelCoefficient() const;
bool isInsideSpeedCondition() const;
bool isInsideTpsCondition() const;
bool isInsideSwitchCondition();