diff --git a/firmware/controllers/sensors/converters/linear_func.cpp b/firmware/controllers/sensors/converters/linear_func.cpp index f54531a6f3..11aa63dccc 100644 --- a/firmware/controllers/sensors/converters/linear_func.cpp +++ b/firmware/controllers/sensors/converters/linear_func.cpp @@ -25,9 +25,3 @@ SensorResult LinearFunc::convert(float inputValue) const { return result; } - -void LinearFunc::showInfo(Logging* logger, float testRawValue) const { - scheduleMsg(logger, " Linear function slope: %.2f offset: %.2f min: %.1f max: %.1f", m_a, m_b, m_minOutput, m_maxOutput); - const auto [valid, value] = convert(testRawValue); - scheduleMsg(logger, " raw value %.2f converts to %.2f valid: %d", testRawValue, value, valid); -} diff --git a/firmware/controllers/sensors/converters/resistance_func.cpp b/firmware/controllers/sensors/converters/resistance_func.cpp index 6553258be3..8a26921a20 100644 --- a/firmware/controllers/sensors/converters/resistance_func.cpp +++ b/firmware/controllers/sensors/converters/resistance_func.cpp @@ -3,7 +3,6 @@ */ #include "resistance_func.h" -#include "loggingcentral.h" void ResistanceFunc::configure(float supplyVoltage, float pullupResistor) { m_pullupResistor = pullupResistor; @@ -26,8 +25,3 @@ SensorResult ResistanceFunc::convert(float raw) const { return resistance; } - -void ResistanceFunc::showInfo(Logging* logger, float testInputValue) const { - const auto result = convert(testInputValue); - scheduleMsg(logger, " %.2f volts -> %.1f ohms with supply voltage %.2f and pullup %.1f.", testInputValue, result.Value, m_supplyVoltage, m_pullupResistor); -} diff --git a/firmware/controllers/sensors/converters/thermistor_func.cpp b/firmware/controllers/sensors/converters/thermistor_func.cpp index 362d3ff5a5..ae77e44ae6 100644 --- a/firmware/controllers/sensors/converters/thermistor_func.cpp +++ b/firmware/controllers/sensors/converters/thermistor_func.cpp @@ -6,7 +6,6 @@ #include "thermistors.h" -#include "loggingcentral.h" #include SensorResult ThermistorFunc::convert(float ohms) const { @@ -46,8 +45,3 @@ void ThermistorFunc::configure(thermistor_conf_s &cfg) { m_b = u2 - m_c * (l1 * l1 + l1 * l2 + l2 * l2); m_a = y1 - (m_b + l1 * l1 * m_c) * l1; } - -void ThermistorFunc::showInfo(Logging* logger, float testInputValue) const { - const auto [valid, value] = convert(testInputValue); - scheduleMsg(logger, " %.1f ohms -> valid: %d. %.1f deg C", testInputValue, valid, value); -} diff --git a/firmware/controllers/sensors/sensor_info_printing.cpp b/firmware/controllers/sensors/sensor_info_printing.cpp index ab6616c921..7d02d245fe 100644 --- a/firmware/controllers/sensors/sensor_info_printing.cpp +++ b/firmware/controllers/sensors/sensor_info_printing.cpp @@ -2,6 +2,9 @@ #include "proxy_sensor.h" #include "functional_sensor.h" #include "redundant_sensor.h" +#include "linear_func.h" +#include "resistance_func.h" +#include "thermistor_func.h" #include "efilib.h" #include "loggingcentral.h" @@ -29,5 +32,21 @@ void CanSensorBase::showInfo(Logging* logger, const char* sensorName) const { #endif // EFI_CAN_SUPPORT void RedundantSensor::showInfo(Logging* logger, const char* sensorName) const { - scheduleMsg(logger, "Redundant sensor \"%s\" combining \"%s\" and \"%s\"", sensorName, getSensorName(m_first), getSensorName(m_second)); + scheduleMsg(logger, "Sensor \"%s\" is redundant combining \"%s\" and \"%s\"", sensorName, getSensorName(m_first), getSensorName(m_second)); +} + +void LinearFunc::showInfo(Logging* logger, float testRawValue) const { + scheduleMsg(logger, " Linear function slope: %.2f offset: %.2f min: %.1f max: %.1f", m_a, m_b, m_minOutput, m_maxOutput); + const auto [valid, value] = convert(testRawValue); + scheduleMsg(logger, " raw value %.2f converts to %.2f valid: %d", testRawValue, value, valid); +} + +void ResistanceFunc::showInfo(Logging* logger, float testInputValue) const { + const auto result = convert(testInputValue); + scheduleMsg(logger, " %.2f volts -> %.1f ohms with supply voltage %.2f and pullup %.1f.", testInputValue, result.Value, m_supplyVoltage, m_pullupResistor); +} + +void ThermistorFunc::showInfo(Logging* logger, float testInputValue) const { + const auto [valid, value] = convert(testInputValue); + scheduleMsg(logger, " %.1f ohms -> valid: %d. %.1f deg C", testInputValue, valid, value); }