better error handling

This commit is contained in:
rusefillc 2020-11-17 22:45:43 -05:00
parent ed652dfd10
commit c70c546d46
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,10 @@ AirmassResult SpeedDensityAirmass::getAirmass(int rpm) {
}
float map = getMap(PASS_ENGINE_PARAMETER_SIGNATURE);
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(map), "NaN map", {});
if (cisnan(map)) {
warning(CUSTOM_ERR_TCHARGE_NOT_READY2, "map not ready"); // this could happen during HW CI during configuration reset
return {};
}
engine->engineState.sd.manifoldAirPressureAccelerationAdjustment = engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE);