48 float y1 = 1 / convertCelsiusToKelvin(cfg.
tempC_1);
49 float y2 = 1 / convertCelsiusToKelvin(cfg.
tempC_2);
50 float y3 = 1 / convertCelsiusToKelvin(cfg.
tempC_3);
52 float u2 = (y2 - y1) / (l2 - l1);
53 float u3 = (y3 - y1) / (l3 - l1);
55 m_c = ((u3 - u2) / (l3 - l2)) / (l1 + l2 + l3);
56 m_b = u2 -
m_c * (l1 * l1 + l1 * l2 + l2 * l2);
60 float tempAt10percentPoint =
convert(resistance10percent).Value;
62 if (tempAt10percentPoint < cfg.
tempC_1) {
64 throw std::logic_error(
"Bad thermistor configuration at the left");
66 criticalError(
"Thermistor configuration has failed 10% test");
70 float tempAt90percentPoint =
convert(resistance90percent).Value;
71 if (tempAt90percentPoint > cfg.
tempC_3) {
73 throw std::logic_error(
"Bad thermistor configuration at the right");
75 criticalError(
"Thermistor configuration has failed 90% test");