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

Functions

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

Variables

bool printTriggerTrace
 
bool printTriggerDebug
 

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:

Variable Documentation

◆ printTriggerDebug

bool printTriggerDebug
extern

sensorChartMode

Definition at line 108 of file trigger_decoder.cpp.

◆ printTriggerTrace

bool printTriggerTrace
extern

Go to the source code of this file.