Skip to content

Commit

Permalink
boostCutPressureHyst impl+tests #4529
Browse files Browse the repository at this point in the history
  • Loading branch information
andreika-git authored and rusefillc committed May 5, 2023
1 parent 586a043 commit 7df63c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions firmware/controllers/limp_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ void LimpManager::updateState(int rpm, efitick_t nowNt) {
// Limit fuel only on boost pressure (limiting spark bends valves)
float mapCut = engineConfiguration->boostCutPressure;
if (mapCut != 0) {
// require drop of 20kPa to resume fuel
if (m_boostCutHysteresis.test(Sensor::getOrZero(SensorType::Map), mapCut, mapCut - 20)) {
// require drop of 'boostCutPressureHyst' kPa to resume fuel
if (m_boostCutHysteresis.test(Sensor::getOrZero(SensorType::Map), mapCut, mapCut - engineConfiguration->boostCutPressureHyst)) {
allowFuel.clear(ClearReason::BoostCut);
}
}
Expand Down
1 change: 1 addition & 0 deletions unit_tests/tests/test_limp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ TEST(limp, boostCut) {

// Cut above 100kPa
engineConfiguration->boostCutPressure = 100;
engineConfiguration->boostCutPressureHyst = 20;

LimpManager dut;

Expand Down

0 comments on commit 7df63c0

Please sign in to comment.