Fuel cut code 4: FaultRevLimit, What is the fault when no indicators are red? #7319
only:uaefi
This commit is contained in:
parent
33a22d1c26
commit
29211ec576
|
@ -113,7 +113,7 @@ void LimpManager::updateState(float rpm, efitick_t nowNt) {
|
||||||
|
|
||||||
// Force fuel limiting on the fault rev limit
|
// Force fuel limiting on the fault rev limit
|
||||||
if (rpm > m_faultRevLimit) {
|
if (rpm > m_faultRevLimit) {
|
||||||
allowFuel.clear(ClearReason::FaultRevLimit);
|
allowFuel.clear(m_rpmLimitReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Limit fuel only on boost pressure (limiting spark bends valves)
|
// Limit fuel only on boost pressure (limiting spark bends valves)
|
||||||
|
@ -249,7 +249,7 @@ void LimpManager::onIgnitionStateChanged(bool ignitionOn) {
|
||||||
|
|
||||||
void LimpManager::reportEtbProblem() {
|
void LimpManager::reportEtbProblem() {
|
||||||
m_allowEtb.clear(ClearReason::EtbProblem);
|
m_allowEtb.clear(ClearReason::EtbProblem);
|
||||||
setFaultRevLimit(/*rpm*/1500);
|
setFaultRevLimit(/*rpm*/1500, ClearReason::EtbFaultRevLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LimpManager::fatalError() {
|
void LimpManager::fatalError() {
|
||||||
|
@ -258,13 +258,16 @@ void LimpManager::fatalError() {
|
||||||
m_allowInjection.clear(ClearReason::Fatal);
|
m_allowInjection.clear(ClearReason::Fatal);
|
||||||
m_allowTriggerInput.clear(ClearReason::Fatal);
|
m_allowTriggerInput.clear(ClearReason::Fatal);
|
||||||
|
|
||||||
setFaultRevLimit(/*rpm*/0);
|
setFaultRevLimit(/*rpm*/0, ClearReason::FatalErrorRevLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LimpManager::setFaultRevLimit(int limit) {
|
void LimpManager::setFaultRevLimit(int limit, ClearReason rpmLimitReason) {
|
||||||
// Only allow decreasing the limit
|
// Only allow decreasing the limit
|
||||||
// aka uses the limit of the worst fault to yet occur
|
// aka uses the limit of the worst fault to yet occur
|
||||||
m_faultRevLimit = minI(m_faultRevLimit, limit);
|
if (limit < m_faultRevLimit) {
|
||||||
|
m_faultRevLimit = limit;
|
||||||
|
m_rpmLimitReason = rpmLimitReason;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_ELECTRONIC_THROTTLE_BODY
|
#if EFI_ELECTRONIC_THROTTLE_BODY
|
||||||
|
|
|
@ -11,7 +11,7 @@ enum class ClearReason : uint8_t {
|
||||||
Fatal, // 1
|
Fatal, // 1
|
||||||
Settings, // 2
|
Settings, // 2
|
||||||
HardLimit, // 3
|
HardLimit, // 3
|
||||||
FaultRevLimit,
|
EtbFaultRevLimit, // 4 means 1500 RPM limit in case of ETB fault
|
||||||
BoostCut, // 5
|
BoostCut, // 5
|
||||||
OilPressure, // 6
|
OilPressure, // 6
|
||||||
StopRequested, // 7
|
StopRequested, // 7
|
||||||
|
@ -25,8 +25,9 @@ enum class ClearReason : uint8_t {
|
||||||
Lua, // 15
|
Lua, // 15
|
||||||
ACR, // 16 - Harley Automatic Compression Release
|
ACR, // 16 - Harley Automatic Compression Release
|
||||||
LambdaProtection, // 17
|
LambdaProtection, // 17
|
||||||
GdiComms,
|
GdiComms, // 18
|
||||||
PleaseBrake,
|
PleaseBrake, // 19
|
||||||
|
FatalErrorRevLimit, // 20
|
||||||
|
|
||||||
// Keep this list in sync with fuelIgnCutCodeList in tunerstudio.template.ini!
|
// Keep this list in sync with fuelIgnCutCodeList in tunerstudio.template.ini!
|
||||||
// todo: add a code generator between ClearReason and fuelIgnCutCodeList in tunerstudio.template.ini
|
// todo: add a code generator between ClearReason and fuelIgnCutCodeList in tunerstudio.template.ini
|
||||||
|
@ -114,7 +115,7 @@ public:
|
||||||
Timer externalGdiCanBusComms;
|
Timer externalGdiCanBusComms;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setFaultRevLimit(int limit);
|
void setFaultRevLimit(int limit, ClearReason rpmLimitReason);
|
||||||
|
|
||||||
Hysteresis m_revLimitHysteresis;
|
Hysteresis m_revLimitHysteresis;
|
||||||
MaxLimitWithHysteresis<> m_boostCutHysteresis;
|
MaxLimitWithHysteresis<> m_boostCutHysteresis;
|
||||||
|
@ -141,6 +142,7 @@ private:
|
||||||
|
|
||||||
// todo: migrate to engineState->desiredRpmLimit to get this variable logged
|
// todo: migrate to engineState->desiredRpmLimit to get this variable logged
|
||||||
float m_revLimit;
|
float m_revLimit;
|
||||||
|
ClearReason m_rpmLimitReason = ClearReason::None;
|
||||||
float resumeRpm;
|
float resumeRpm;
|
||||||
|
|
||||||
// Tracks how long since a cut (ignition or fuel) was active for any reason
|
// Tracks how long since a cut (ignition or fuel) was active for any reason
|
||||||
|
|
Loading…
Reference in New Issue