rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
vehicle_speed_converter.h
Go to the documentation of this file.
1#include "pch.h"
3
5public:
6 SensorResult convert(float frequency) const override {
8
9 auto pulsePerKm = (vssRevPerKm * engineConfiguration->vssToothCount);
10
11 if (pulsePerKm == 0) {
12 // avoid div by 0
13 return 0;
14 }
15
16 auto kmPerPulse = 1 / pulsePerKm;
17
18 // 1 pulse 3600 sec 1 km km
19 // --------- * ---------- * --------- = ----
20 // sec 1 hr 1 pulse hr
21 return frequency * 3600 * kmPerPulse;
22 }
23};
SensorResult convert(float frequency) const override
static constexpr engine_configuration_s * engineConfiguration
static float frequency
Definition init_flex.cpp:21
expected< float > SensorResult
Definition sensor.h:46