rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions
TriggerEmulatorHelper Class Reference

#include <trigger_emulator_algo.h>

Public Member Functions

 TriggerEmulatorHelper ()
 
void handleEmulatorCallback (int channel, const MultiChannelStateSequence &mcss, int stateIndex)
 

Detailed Description

Definition at line 27 of file trigger_emulator_algo.h.

Constructor & Destructor Documentation

◆ TriggerEmulatorHelper()

TriggerEmulatorHelper::TriggerEmulatorHelper ( )

Member Function Documentation

◆ handleEmulatorCallback()

void TriggerEmulatorHelper::handleEmulatorCallback ( int  channel,
const MultiChannelStateSequence mcss,
int  stateIndex 
)

Definition at line 46 of file trigger_emulator_algo.cpp.

46 {
47 efitick_t stamp = getTimeNowNt();
48
49 // todo: code duplication with TriggerStimulatorHelper::feedSimulatedEvent?
50#if EFI_SHAFT_POSITION_INPUT
51 for (size_t i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
52 if (needEvent(stateIndex, multiChannelStateSequence, i)) {
53 bool isRise = TriggerValue::RISE == multiChannelStateSequence.getChannelState(/*phaseIndex*/i, stateIndex);
54
57
58 if (channel == 0) {
59 handleShaftSignal(i, isRise, stamp);
60 } else {
61 handleVvtCamSignal(isRise ? TriggerValue::RISE : TriggerValue::FALL, stamp, INDEX_BY_BANK_CAM(channel - 1, i));
62 }
63 }
64 }
65#endif // EFI_SHAFT_POSITION_INPUT
66}
uint16_t channel
Definition adc_inputs.h:104
efitick_t getTimeNowNt()
Definition efitime.cpp:19
static constexpr engine_configuration_s * engineConfiguration
TriggerValue
void handleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index)
void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp)
bool needEvent(const int currentIndex, const MultiChannelStateSequence &mcss, int channelIndex)

Referenced by emulatorApplyPinState().

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

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