refactoring

This commit is contained in:
rusefillc 2021-10-16 23:17:45 -04:00
parent 6e67697284
commit 296f83ea4d
1 changed files with 12 additions and 7 deletions

View File

@ -34,6 +34,10 @@ AirmassResult SpeedDensityAirmass::getAirmass(int rpm) {
}
float SpeedDensityAirmass::getMap(int rpm) const {
SensorResult map = Sensor::get(SensorType::Map);
if (map) {
return map.Value;
} else {
float fallbackMap;
if (CONFIG(enableMapEstimationTableFallback)) {
// if the map estimation table is enabled, estimate map based on the TPS and RPM
@ -48,5 +52,6 @@ float SpeedDensityAirmass::getMap(int rpm) const {
}
#endif // EFI_TUNER_STUDIO
return Sensor::get(SensorType::Map).value_or(fallbackMap);
return fallbackMap;
}
}