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/**
4 * GMT800 platform (1999–2007 classic Chevrolet Silverado/GMC Sierra, Tahoe, Yukon, etc.)
5 * 4000 pulses per mile
6 * 2485 pulses per kilometer
7 */
8
9#include "speedometer.h"
10
11static SimplePwm speedoPwm("speedo");
12
13static bool hasSpeedoInit = false;
14
16 if (!hasSpeedoInit) {
17 return;
18 }
19
21 float kps = kph * (1. / 3600);
23
24 if (freq < 1) {
25 freq = NAN;
26 }
27
29}
30
32 hasSpeedoInit = false;
33
35 return;
36 }
37
39 "Speedometer",
42 NAN, 0.5f);
43
44 hasSpeedoInit = true;
45}
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")