2021-09-19 17:50:11 -07:00
|
|
|
/**
|
|
|
|
* Frequency to RPM converter for turbocharger pin
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "pch.h"
|
|
|
|
#include "sensor_converter_func.h"
|
|
|
|
|
2021-11-16 13:52:11 -08:00
|
|
|
class TurbochargerSpeedConverter : public SensorConverter {
|
2021-09-19 17:50:11 -07:00
|
|
|
public:
|
|
|
|
SensorResult convert(float frequency) const override {
|
2021-09-20 12:39:41 -07:00
|
|
|
auto hz = frequency * engineConfiguration->turboSpeedSensorMultiplier;
|
|
|
|
|
|
|
|
auto rpm = hz * 60;
|
|
|
|
|
|
|
|
return rpm;
|
2021-09-19 17:50:11 -07:00
|
|
|
}
|
|
|
|
};
|