2020-03-23 17:44:34 -07:00
|
|
|
/*
|
|
|
|
* @file launch_control.h
|
|
|
|
*
|
|
|
|
* @date Mar 23, 2020
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-11-19 05:15:56 -08:00
|
|
|
#include "engine_ptr.h"
|
2020-11-30 16:35:06 -08:00
|
|
|
#include "timer.h"
|
2020-03-23 17:44:34 -07:00
|
|
|
|
2021-04-20 11:09:41 -07:00
|
|
|
void initLaunchControl(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2020-03-23 20:20:54 -07:00
|
|
|
void setDefaultLaunchParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
2021-11-15 11:40:35 -08:00
|
|
|
|
2021-11-15 03:44:40 -08:00
|
|
|
class LaunchControlBase : public EnginePtr {
|
2020-11-19 05:15:56 -08:00
|
|
|
public:
|
|
|
|
// Update the state of the launch control system
|
|
|
|
void update();
|
|
|
|
|
|
|
|
bool isInsideSpeedCondition() const;
|
|
|
|
bool isInsideTpsCondition() const;
|
2020-11-19 18:14:38 -08:00
|
|
|
bool isInsideSwitchCondition() const;
|
|
|
|
bool isInsideRPMCondition(int rpm) const;
|
2020-11-19 05:15:56 -08:00
|
|
|
bool isLaunchConditionMet(int rpm) const;
|
2021-11-15 11:40:35 -08:00
|
|
|
int retardThresholdRpm;
|
|
|
|
void applyLaunchControlLimiting(bool *limitedSpark, bool *limitedFuel DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2020-11-19 05:15:56 -08:00
|
|
|
|
|
|
|
private:
|
2020-11-30 16:35:06 -08:00
|
|
|
Timer m_launchTimer;
|
2020-11-19 05:15:56 -08:00
|
|
|
};
|