rusEFI
The most advanced open source ECU
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 ()
 
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 39 of file fuel_schedule.cpp.

39  {
40  for (int cylinderIndex = 0; cylinderIndex < MAX_CYLINDER_COUNT; cylinderIndex++) {
41  elements[cylinderIndex].setIndex(cylinderIndex);
42  }
43 }
InjectionEvent elements[MAX_CYLINDER_COUNT]
Definition: fuel_schedule.h:82
void setIndex(uint8_t index)
Definition: fuel_schedule.h:27
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 207 of file fuel_schedule.cpp.

207  {
208  for (size_t cylinderIndex = 0; cylinderIndex < engineConfiguration->cylindersCount; cylinderIndex++) {
209  bool result = elements[cylinderIndex].update();
210 
211  if (!result) {
212  invalidate();
213  return;
214  }
215  }
216 
217  // We made it through all cylinders, mark the schedule as ready so it can be used
218  isReady = true;
219 }
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 49 of file fuel_schedule.cpp.

49  {
50  isReady = false;
51 }

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 221 of file fuel_schedule.cpp.

221  {
222  // Wait for schedule to be built - this happens the first time we get RPM
223  if (!isReady) {
224  return;
225  }
226 
227  for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
228  elements[i].onTriggerTooth(nowNt, currentPhase, nextPhase);
229  }
230 }
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 ( )

Definition at line 53 of file fuel_schedule.cpp.

53  {
54  for (size_t i = 0; i < efi::size(enginePins.injectors); i++) {
56  }
57 }
InjectorOutputPin injectors[MAX_CYLINDER_COUNT]
Definition: efi_gpio.h:122
EnginePins enginePins
Definition: efi_gpio.cpp:24
composite packet size

Referenced by RpmCalculator::setRpmValue().

Here is the call graph for this function:
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(), onTriggerTooth(), resetAccel(), and updateFuelInfo().

◆ isReady

bool FuelSchedule::isReady = false

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