2021-09-19 17:50:11 -07:00
|
|
|
#include "pch.h"
|
|
|
|
|
2022-09-19 09:06:00 -07:00
|
|
|
/**
|
|
|
|
* See init_input_shaft_speed_sensor.cpp concerns - those might apply here as well!
|
|
|
|
*/
|
|
|
|
|
2021-09-19 17:50:11 -07:00
|
|
|
#include "init.h"
|
|
|
|
#include "frequency_sensor.h"
|
|
|
|
#include "turbocharger_speed_converter.h"
|
|
|
|
|
2022-04-09 06:00:19 -07:00
|
|
|
static FrequencySensor turbochargerSpeedSensor(SensorType::TurbochargerSpeed, MS2NT(500));
|
2021-09-19 17:50:11 -07:00
|
|
|
static TurbochargerSpeedConverter turbochargerSpeedConverter;
|
|
|
|
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void initTurbochargerSpeedSensor() {
|
2022-04-09 06:00:19 -07:00
|
|
|
// Filter parameter of 0.01 filters over roughly 100 teeth
|
2022-09-19 09:06:00 -07:00
|
|
|
turbochargerSpeedSensor.initIfValid(engineConfiguration->turboSpeedSensorInputPin, turbochargerSpeedConverter, engineConfiguration->turbochargerFilter);
|
2021-09-19 17:50:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void deinitTurbochargerSpeedSensor() {
|
|
|
|
turbochargerSpeedSensor.deInit();
|
2022-03-28 20:30:37 -07:00
|
|
|
}
|