Temperature sensors issue fix #2629

This commit is contained in:
rusefillc 2021-05-06 13:58:01 -04:00
parent e32ec60dbe
commit e2c5a13dbc
1 changed files with 6 additions and 7 deletions

View File

@ -28,13 +28,12 @@ static CCM_OPTIONAL FunctionalSensor aux2(SensorType::AuxTemp2, MS2NT(10));
static FuncPair fclt, fiat, faux1, faux2; static FuncPair fclt, fiat, faux1, faux2;
void validateThermistorConfig(thermistor_conf_s& cfg) { void validateThermistorConfig(thermistor_conf_s& cfg) {
if ( if (cfg.tempC_1 >= cfg.tempC_2 ||
cfg.tempC_1 >= cfg.tempC_2 || cfg.tempC_2 >= cfg.tempC_3) {
cfg.tempC_2 >= cfg.tempC_3 || firmwareError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction, "Invalid thermistor configuration: please check that temperatures are in the ascending order %f %f %f",
cfg.resistance_1 < cfg.resistance_2 || cfg.tempC_1,
cfg.resistance_2 < cfg.resistance_3 cfg.tempC_2,
) { cfg.tempC_3);
firmwareError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction, "Invalid thermistor configuration: please check that temperatures & resistances are in the correct order.");
} }
} }