rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
speedometer.cpp
Go to the documentation of this file.
1#include "pch.h"
2
3#include "speedometer.h"
4
5static SimplePwm speedoPwm("speedo");
6
7static bool hasSpeedoInit = false;
8
10 if (!hasSpeedoInit) {
11 return;
12 }
13
15 float kps = kph * (1. / 3600);
17
18 if (freq < 1) {
19 freq = NAN;
20 }
21
23}
24
26 hasSpeedoInit = false;
27
29 return;
30 }
31
33 "Speedometer",
36 NAN, 0.5f);
37
38 hasSpeedoInit = true;
39}
SingleTimerExecutor scheduler
Definition engine.h:271
RegisteredOutputPin speedoOut
Definition efi_gpio.h:122
void setFrequency(float frequency)
static float getOrZero(SensorType type)
Definition sensor.h:83
EnginePins enginePins
Definition efi_gpio.cpp:24
static EngineAccessor engine
Definition engine.h:413
static constexpr engine_configuration_s * engineConfiguration
bool isBrainPinValid(brain_pin_e brainPin)
void startSimplePwm(SimplePwm *state, const char *msg, Scheduler *executor, OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *callback)
void speedoUpdate()
void initSpeedometer()
static bool hasSpeedoInit
static SimplePwm speedoPwm("speedo")