rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields
FuelSchedule Class Reference

#include <fuel_schedule.h>

Collaboration diagram for FuelSchedule:
Collaboration graph
[legend]

Public Member Functions

 FuelSchedule ()
 
void invalidate ()
 
void onTriggerTooth (efitick_t nowNt, float currentPhase, float nextPhase)
 
void addFuelEvents ()
 

Static Public Member Functions

static void resetOverlapping ()
 

Data Fields

InjectionEvent elements [MAX_CYLINDER_COUNT]
 
bool isReady = false
 

Detailed Description

This class knows about when to inject fuel

Definition at line 61 of file fuel_schedule.h.

Constructor & Destructor Documentation

◆ FuelSchedule()

FuelSchedule::FuelSchedule ( )

Definition at line 33 of file fuel_schedule.cpp.

33 {
34 for (int cylinderIndex = 0; cylinderIndex < MAX_CYLINDER_COUNT; cylinderIndex++) {
35 elements[cylinderIndex].setIndex(cylinderIndex);
36 }
37}
InjectionEvent elements[MAX_CYLINDER_COUNT]
void setIndex(uint8_t index)
Here is the call graph for this function:

Member Function Documentation

◆ addFuelEvents()

void FuelSchedule::addFuelEvents ( )

this method schedules all fuel events for an engine cycle Calculate injector opening angle, pins, and mode for all injectors

Definition at line 202 of file fuel_schedule.cpp.

202 {
203 for (size_t cylinderIndex = 0; cylinderIndex < engineConfiguration->cylindersCount; cylinderIndex++) {
204 bool result = elements[cylinderIndex].update();
205
206 if (!result) {
207 invalidate();
208 return;
209 }
210 }
211
212 // We made it through all cylinders, mark the schedule as ready so it can be used
213 isReady = true;
214}
static constexpr engine_configuration_s * engineConfiguration

Referenced by commonInitEngineController(), handleFuel(), and RpmCalculator::setRpmValue().

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

◆ invalidate()

void FuelSchedule::invalidate ( )

Definition at line 43 of file fuel_schedule.cpp.

43 {
44 isReady = false;
45}

Referenced by addFuelEvents(), and prepareOutputSignals().

Here is the caller graph for this function:

◆ onTriggerTooth()

void FuelSchedule::onTriggerTooth ( efitick_t  nowNt,
float  currentPhase,
float  nextPhase 
)

Definition at line 216 of file fuel_schedule.cpp.

216 {
217 // Wait for schedule to be built - this happens the first time we get RPM
218 if (!isReady) {
219 return;
220 }
221
222 for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
223 elements[i].onTriggerTooth(nowNt, currentPhase, nextPhase);
224 }
225}
void onTriggerTooth(efitick_t nowNt, float currentPhase, float nextPhase)

Referenced by handleFuel().

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

◆ resetOverlapping()

void FuelSchedule::resetOverlapping ( )
static

Definition at line 47 of file fuel_schedule.cpp.

47 {
48 for (auto& inj : enginePins.injectors) {
49 inj.reset();
50 }
51}
EnginePins enginePins
Definition efi_gpio.cpp:24

Referenced by RpmCalculator::setRpmValue().

Here is the caller graph for this function:

Field Documentation

◆ elements

InjectionEvent FuelSchedule::elements[MAX_CYLINDER_COUNT]

injection events, per cylinder

Definition at line 82 of file fuel_schedule.h.

Referenced by addFuelEvents(), FuelSchedule(), getLiveData(), onTriggerTooth(), resetAccel(), and updateFuelInfo().

◆ isReady

bool FuelSchedule::isReady = false

The documentation for this class was generated from the following files: