rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
vr_pwm.h File Reference

Functions

void initVrThresholdPwm ()
 
void updateVrThresholdPwm ()
 
void setDefaultVrThresholds ()
 

Function Documentation

◆ initVrThresholdPwm()

void initVrThresholdPwm ( )

Definition at line 39 of file vr_pwm.cpp.

39 {
40 for (size_t i = 0; i < efi::size(engineConfiguration->vrThreshold); i++) {
41 auto& cfg = engineConfiguration->vrThreshold[i];
42
43 if (!isBrainPinValid(cfg.pin)) {
44 continue;
45 }
46
47 startSimplePwmHard(&pwms[i], "VR Threshold",
49 cfg.pin,
50 &pins[i],
51 10000, // it's guaranteed to be hardware PWM, the faster the PWM, the less noise makes it through
52 0
53 );
54 }
55}
SingleTimerExecutor scheduler
Definition engine.h:271
static EngineAccessor engine
Definition engine.h:413
static constexpr engine_configuration_s * engineConfiguration
bool isBrainPinValid(brain_pin_e brainPin)
void startSimplePwmHard(SimplePwm *state, const char *msg, Scheduler *executor, brain_pin_e brainPin, OutputPin *output, float frequency, float dutyCycle)
static OutputPin pins[VR_THRESHOLD_COUNT]
Definition vr_pwm.cpp:5
static SimplePwm pwms[VR_THRESHOLD_COUNT]
Definition vr_pwm.cpp:6

Referenced by initRealHardwareEngineController().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDefaultVrThresholds()

void setDefaultVrThresholds ( )

Definition at line 57 of file vr_pwm.cpp.

57 {
58 for (int i = 0;i<VR_THRESHOLD_COUNT;i++) {
61 }
62}
void setRpmTableBin(TValue(&array)[TSize])
void setLinearCurve(TValue(&array)[TSize], float from, float to, float precision=0.01f)

Referenced by setDefaultBaseEngine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateVrThresholdPwm()

void updateVrThresholdPwm ( )

Definition at line 31 of file vr_pwm.cpp.

31 {
33
34 for (size_t i = 0; i < efi::size(engineConfiguration->vrThreshold); i++) {
36 }
37}
static float getOrZero(SensorType type)
Definition sensor.h:83
void updateVrThresholdPwm()
Definition vr_pwm.cpp:31

Referenced by Engine::periodicSlowCallback(), and updateVrThresholdPwm().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.