rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures | Functions
trigger_simulator.h File Reference

Data Structures

class  TriggerStimulatorHelper
 

Functions

int getSimulatedEventTime (const TriggerWaveform &shape, int i)
 
bool isUsefulSignal (trigger_event_e signal, const TriggerWaveform &shape)
 

Function Documentation

◆ getSimulatedEventTime()

int getSimulatedEventTime ( const TriggerWaveform shape,
int  i 
)

Definition at line 34 of file trigger_simulator.cpp.

34 {
35 int stateIndex = i % shape.getSize();
36 int loopIndex = i / shape.getSize();
37
38 return (int) (SIMULATION_CYCLE_PERIOD * (loopIndex + shape.wave.getSwitchTime(stateIndex)));
39}
float getSwitchTime(int phaseIndex) const override
MultiChannelStateSequenceWithData< PWM_PHASE_MAX_COUNT > wave
size_t getSize() const

Referenced by TriggerStimulatorHelper::feedSimulatedEvent().

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

◆ isUsefulSignal()

bool isUsefulSignal ( trigger_event_e  signal,
const TriggerWaveform shape 
)

todo: should this method be invoked somewhere deeper? at the moment we have too many usages too high

Returns
true if front should be decoded further, false if we are not interested

Definition at line 21 of file trigger_simulator.cpp.

21 {
22 if (shape.useOnlyRisingEdges) {
23 return isTriggerUpEvent(signal);
24 }
25
26 // consider both edges, so all edges are useful
27 return true;
28}
constexpr bool isTriggerUpEvent(trigger_event_e event)

Referenced by TriggerStimulatorHelper::feedSimulatedEvent(), handleShaftSignal(), and TriggerCentral::handleShaftSignal().

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

Go to the source code of this file.