rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Private Attributes
AngleBasedEvent Struct Reference

#include <event_registry.h>

Collaboration diagram for AngleBasedEvent:
Collaboration graph
[legend]

Public Member Functions

angle_t getAngle () const
 
void setAngle (angle_t p_enginePhase)
 
bool shouldSchedule (float currentPhase, float nextPhase) const
 
float getAngleFromNow (float currentPhase) const
 

Data Fields

scheduling_s eventScheduling
 
action_s action
 
AngleBasedEventnextToothEvent = nullptr
 

Private Attributes

angle_t enginePhase
 

Detailed Description

Definition at line 16 of file event_registry.h.

Member Function Documentation

◆ getAngle()

angle_t AngleBasedEvent::getAngle ( ) const
inline

Definition at line 25 of file event_registry.h.

25 {
26 return enginePhase;
27 }

Referenced by TriggerScheduler::schedule(), and scheduleSparkEvent().

Here is the caller graph for this function:

◆ getAngleFromNow()

float AngleBasedEvent::getAngleFromNow ( float  currentPhase) const

Definition at line 158 of file trigger_scheduler.cpp.

158 {
159 float angleOffset = this->enginePhase - currentPhase;
160 if (angleOffset < 0) {
161 angleOffset += engine->engineState.engineCycle;
162 }
163
164 return angleOffset;
165}
EngineState engineState
Definition engine.h:344
angle_t engineCycle
static EngineAccessor engine
Definition engine.h:413

Referenced by TriggerScheduler::scheduleEventsUntilNextTriggerTooth(), and TriggerScheduler::scheduleOrQueue().

Here is the caller graph for this function:

◆ setAngle()

void AngleBasedEvent::setAngle ( angle_t  p_enginePhase)
inline

Definition at line 29 of file event_registry.h.

29 {
30 enginePhase = p_enginePhase;
31 }

◆ shouldSchedule()

bool AngleBasedEvent::shouldSchedule ( float  currentPhase,
float  nextPhase 
) const

Definition at line 154 of file trigger_scheduler.cpp.

154 {
155 return isPhaseInRange(this->enginePhase, currentPhase, nextPhase);
156}
bool isPhaseInRange(float test, float current, float next)
Definition efilib.cpp:176

Referenced by TriggerScheduler::scheduleEventsUntilNextTriggerTooth(), and TriggerScheduler::scheduleOrQueue().

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

Field Documentation

◆ action

action_s AngleBasedEvent::action

◆ enginePhase

angle_t AngleBasedEvent::enginePhase
private

Definition at line 36 of file event_registry.h.

Referenced by getAngle(), getAngleFromNow(), setAngle(), and shouldSchedule().

◆ eventScheduling

scheduling_s AngleBasedEvent::eventScheduling

◆ nextToothEvent

AngleBasedEvent* AngleBasedEvent::nextToothEvent = nullptr

Trigger-based scheduler maintains a linked list of all pending tooth-based events.

Definition at line 22 of file event_registry.h.

Referenced by TriggerScheduler::scheduleEventsUntilNextTriggerTooth().


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