rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
aux_valves.cpp File Reference

Functions

static void plainPinTurnOff (NamedOutputPin *output)
 
static void scheduleOpen (AuxActor *current)
 
void auxPlainPinTurnOn (AuxActor *current)
 
void initAuxValves ()
 
void recalculateAuxValveTiming ()
 

Function Documentation

◆ auxPlainPinTurnOn()

void auxPlainPinTurnOn ( AuxActor current)

Definition at line 38 of file aux_valves.cpp.

38 {
39 NamedOutputPin *output = &enginePins.auxValve[current->valveIndex];
40 output->setHigh();
41
42 scheduleOpen(current);
43
45
46 wrapAngle(duration, "duration", ObdCode::CUSTOM_ERR_6557);
47
48 engine->module<TriggerScheduler>()->schedule(
49 "aux-valve",
50 &current->close,
52 action_s::make<plainPinTurnOff>( output )
53 );
54 }
static void scheduleOpen(AuxActor *current)
angle_t extra
AngleBasedEvent close
EngineState engineState
Definition engine.h:344
constexpr auto & module()
Definition engine.h:200
NamedOutputPin auxValve[AUX_DIGITAL_VALVE_COUNT]
Definition efi_gpio.h:131
float auxValveStart
float auxValveEnd
virtual void setHigh(const char *msg)
Definition efi_gpio.cpp:442
EnginePins enginePins
Definition efi_gpio.cpp:24
static EngineAccessor engine
Definition engine.h:413
@ CUSTOM_ERR_6557
float angle_t
void wrapAngle(angle_t &angle, const char *msg, ObdCode code)
Here is the call graph for this function:

◆ initAuxValves()

void initAuxValves ( )

Definition at line 56 of file aux_valves.cpp.

56 {
58 return;
59 }
60
62 firmwareError(ObdCode::CUSTOM_OBD_91, "No TPS for Aux Valves");
63 return;
64 }
65
67
68 for (int valveIndex = 0; valveIndex < AUX_DIGITAL_VALVE_COUNT; valveIndex++) {
69
70 for (int phaseIndex = 0; phaseIndex < 2; phaseIndex++) {
71 AuxActor *actor = &engine->auxValves[valveIndex][phaseIndex];
72 actor->phaseIndex = phaseIndex;
73 actor->valveIndex = valveIndex;
74 actor->extra = phaseIndex * 360 + valveIndex * 180;
75
76 scheduleOpen(actor);
77 }
78 }
79}
void recalculateAuxValveTiming()
AuxActor auxValves[AUX_DIGITAL_VALVE_COUNT][2]
Definition engine.h:253
virtual bool hasSensor() const
Definition sensor.h:141
static constexpr engine_configuration_s * engineConfiguration
void firmwareError(ObdCode code, const char *fmt,...)
@ CUSTOM_OBD_91
bool isBrainPinValid(brain_pin_e brainPin)
@ DriverThrottleIntent

Referenced by commonInitEngineController().

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

◆ plainPinTurnOff()

static void plainPinTurnOff ( NamedOutputPin output)
static

Definition at line 24 of file aux_valves.cpp.

24 {
25 output->setLow();
26}
virtual void setLow(const char *msg)
Definition efi_gpio.cpp:464
Here is the call graph for this function:

◆ recalculateAuxValveTiming()

void recalculateAuxValveTiming ( )

Definition at line 81 of file aux_valves.cpp.

81 {
83 return;
84 }
85
87 if (!tps) {
88 // error should be already reported by now
89 return;
90 }
91
92 engine->engineState.auxValveStart = interpolate2d(tps.Value,
95
96 engine->engineState.auxValveEnd = interpolate2d(tps.Value,
99
101 // this is a fatal error to make this really visible
102 firmwareError(ObdCode::CUSTOM_AUX_OUT_OF_ORDER, "out of order at %.2f %.2f %.2f", tps,
105 }
106}
virtual SensorResult get() const =0
static constexpr persistent_config_s * config
@ CUSTOM_AUX_OUT_OF_ORDER

Referenced by initAuxValves(), and EngineState::periodicFastCallback().

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

◆ scheduleOpen()

static void scheduleOpen ( AuxActor current)
static

Definition at line 29 of file aux_valves.cpp.

29 {
30 engine->module<TriggerScheduler>()->schedule(
31 "aux-valve",
32 &current->open,
34 action_s::make<auxPlainPinTurnOn>( current )
35 );
36}
AngleBasedEvent open

Referenced by auxPlainPinTurnOn(), and initAuxValves().

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

Go to the source code of this file.