warn about fuel pressure sensor instead of error

only:f407-discovery
This commit is contained in:
Matthew Kennedy 2023-06-23 04:27:24 -04:00 committed by Andrey
parent 41563266a6
commit f1e21697d6
4 changed files with 12 additions and 3 deletions

View File

@ -83,7 +83,7 @@ expected<float> InjectorModelWithConfig::getFuelDifferentialPressure() const {
- map.value_or(101.325);
case ICM_SensedRailPressure: {
if (!Sensor::hasSensor(SensorType::FuelPressureInjector)) {
criticalError("Fuel pressure compensation is set to use a pressure sensor, but none is configured.");
warning(ObdCode::OBD_Fuel_Pressure_Sensor_Missing, "Fuel pressure compensation is set to use a pressure sensor, but none is configured.");
return unexpected;
}

View File

@ -108,7 +108,7 @@ enum class ObdCode : uint16_t {
//P0087 Fuel Rail/System Pressure - Too Low
//P0088 Fuel Rail/System Pressure - Too High
//P0089 Fuel Pressure Regulator 1 Performance
//P0090 Fuel Pressure Regulator 1 Control Circuit
OBD_Fuel_Pressure_Sensor_Missing = 90,
//P0091 Fuel Pressure Regulator 1 Control Circuit Low
//P0092 Fuel Pressure Regulator 1 Control Circuit High
//P0093 Fuel System Leak Detected - Large Leak

View File

@ -295,6 +295,7 @@ enable2ndByteCanID = false
maintainConstantValue = throttlePedalSecondaryWOTVoltage, { (calibrationMode == @@TsCalMode_PedalMax@@ ) ? calibrationValue2 : throttlePedalSecondaryWOTVoltage }
requiresPowerCycle = boardUseCanTerminator
requiresPowerCycle = injectorCompensationMode
requiresPowerCycle = skipBoardCanDash
requiresPowerCycle = knockBandCustom
requiresPowerCycle = lps25BaroSensorScl

View File

@ -308,6 +308,8 @@ TEST(InjectorModel, FailedPressureSensor) {
EXPECT_EQ(1.0f, dut.getInjectorFlowRatio());
}
extern WarningCodeState unitTestWarningCodeState;
TEST(InjectorModel, MissingPressureSensor) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
@ -319,6 +321,12 @@ TEST(InjectorModel, MissingPressureSensor) {
// Sensor is missing!
Sensor::resetMockValue(SensorType::FuelPressureInjector);
int warningsBefore = eth.recentWarnings()->getCount();
dut.getInjectorFlowRatio();
int warningsAfter = eth.recentWarnings()->getCount();
ASSERT_EQ(1, warningsAfter - warningsBefore);
EXPECT_EQ(ObdCode::OBD_Fuel_Pressure_Sensor_Missing, unitTestWarningCodeState.recentWarnings.get(0).Code);
// Missing sensor should trigger a fatal as it's a misconfiguration
EXPECT_FATAL_ERROR(dut.getInjectorFlowRatio());
//EXPECT_FATAL_ERROR(dut.getInjectorFlowRatio());
}