fome-fw/firmware/controllers/algo/launch_control.h

38 lines
765 B
C
Raw Normal View History

2020-03-23 17:44:34 -07:00
/*
* @file launch_control.h
*
* @date Mar 23, 2020
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#pragma once
#include "engine_ptr.h"
2020-11-30 16:35:06 -08:00
#include "timer.h"
2020-03-23 17:44:34 -07:00
void initLaunchControl();
2021-11-15 11:40:35 -08:00
class LaunchControlBase : public EnginePtr {
public:
// Update the state of the launch control system
void update();
bool isInsideSpeedCondition() const;
bool isInsideTpsCondition() const;
2021-11-15 17:09:03 -08:00
bool isInsideSwitchCondition();
bool isInsideRPMCondition(int rpm) const;
2021-11-15 17:09:03 -08:00
bool isLaunchConditionMet(int rpm);
2021-11-15 16:54:34 -08:00
bool isLaunchSparkRpmRetardCondition() const;
bool isLaunchFuelRpmRetardCondition() const;
2021-11-15 11:40:35 -08:00
int retardThresholdRpm;
2021-11-15 17:09:03 -08:00
bool launchActivatePinState = false;
bool isLaunchCondition = false;
private:
2021-11-15 16:54:34 -08:00
bool isLaunchRpmRetardCondition() const;
2020-11-30 16:35:06 -08:00
Timer m_launchTimer;
};