open loop boost does not really require Map sensor

only:small-can-board
This commit is contained in:
Andrey 2023-10-19 21:22:59 -04:00
parent 300e08d4c4
commit f2453ce251
2 changed files with 5 additions and 0 deletions

View File

@ -47,6 +47,10 @@ void BoostController::onConfigurationChange(engine_configuration_s const * previ
expected<float> BoostController::observePlant() {
expected<float> map = Sensor::get(SensorType::Map);
if (!map.Valid && engineConfiguration->boostType != CLOSED_LOOP) {
// if we're in open loop only let's somewhat operate even without valid Map sensor
map = 0;
}
isPlantValid = map.Valid;
return map;
}

View File

@ -33,6 +33,7 @@ TEST(BoostControl, Setpoint) {
TEST(BoostControl, ObservePlant) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->boostType = CLOSED_LOOP;
BoostController bc;