TurboMarian is the ALS boss

This commit is contained in:
rusefillc 2022-12-16 18:58:39 -05:00
parent b3954122d6
commit d696ad52b3
2 changed files with 48 additions and 0 deletions

View File

@ -21,6 +21,10 @@
#define EFI_LAUNCH_CONTROL TRUE
#endif
#ifndef EFI_ANTILAG_SYSTEM
#define EFI_ANTILAG_SYSTEM TRUE
#endif
#define EFI_DYNO_VIEW TRUE
#ifndef EFI_CDM_INTEGRATION

View File

@ -0,0 +1,44 @@
/*
* @file antilag_system.h
*
* @date 26. nov. 2022
* Author: Turbo Marian
*/
#pragma once
#include "timer.h"
#include "antilag_system_state_generated.h"
void initAntilagSystem();
class AntilagSystemBase : public antilag_system_state_s {
public:
AntilagSystemBase();
// Update the state of the launch control system
void update();
bool isALSMinRPMCondition() const;
bool isALSMaxRPMCondition() const;
bool isALSMinCLTCondition() const;
bool isALSMaxCLTCondition() const;
bool isALSMaxTPSCondition() const;
bool isAntilagConditionMet(int rpm);
bool isInsideALSSwitchCondition();
};
/**
* See also SoftLimiterSandbox.java
*/
class ALSSoftSparkLimiter {
public:
/**
* targetSkipRatio of '0' means 'do not skip', would always return false
*/
void setTargetSkipRatio(float ALSSkipRatio);
bool shouldSkip();
private:
bool wasJustSkipped = false;
float ALSSkipRatio = 0;
};