13#include <rusefi/timer.h>
19#if EFI_SHAFT_POSITION_INPUT
74 size_t eventCount[PWM_PHASE_MAX_WAVE_PER_PWM];
118 const efitick_t nowNt);
121 bool wasSynchronized,
122 const efitick_t nowNt,
trigger_config_s getType() const override
PrimaryTriggerConfiguration()
bool isVerboseTriggerSynchDetails() const override
void setNeedsDisambiguation(bool needsDisambiguation)
void onTooManyTeeth(int actual, int expected) override
void resetState() override
void onTriggerError() override
void onNotEnoughTeeth(int actual, int expected) override
bool m_needsDisambiguation
angle_t syncEnginePhase(int divider, int remainder, angle_t engineCycle)
bool hasSynchronizedPhase() const
virtual bool isVerboseTriggerSynchDetails() const =0
TriggerConfiguration(const char *printPrefix)
const char *const PrintPrefix
trigger_config_s TriggerType
bool VerboseTriggerSynchDetails
virtual trigger_config_s getType() const =0
virtual void resetState()
efitick_t mostRecentSyncTime
void printGaps(const char *prefix, const TriggerConfiguration &triggerConfiguration, const TriggerWaveform &triggerShape)
void resetCurrentCycleState()
void incrementShaftSynchronizationCounter()
virtual void onTriggerError()
float gapRatio[PWM_PHASE_MAX_COUNT *6]
void onShaftSynchronization(bool wasSynchronized, const efitick_t nowNt, const TriggerWaveform &triggerShape)
int getCurrentIndex() const
uint32_t findTriggerZeroEventIndex(TriggerWaveform &shape, const TriggerConfiguration &triggerConfiguration)
virtual void onNotEnoughTeeth(int, int)
virtual void onTooManyTeeth(int, int)
Timer m_timeSinceDecodeError
uint32_t orderingErrorCounter
efitick_t toothed_previous_time
bool shaft_is_synchronized
int getSynchronizationCounter() const
int getEventCountersError(const TriggerWaveform &triggerShape) const
void setShaftSynchronized(bool value)
int64_t totalEventCountBase
int64_t getTotalEventCounter() const
trigger_event_e prevSignal
expected< TriggerDecodeResult > decodeTriggerEvent(const char *msg, const TriggerWaveform &triggerShape, TriggerStateListener *triggerStateListener, const TriggerConfiguration &triggerConfiguration, const trigger_event_e signal, const efitick_t nowNt)
Trigger decoding happens here VR falls are filtered out and some VR noise detection happens prior to ...
bool isValidIndex(const TriggerWaveform &triggerShape) const
current_cycle_state_s currentCycle
bool someSortOfTriggerError() const
void setTriggerErrorState(int errorIncrement=1)
uint32_t toothDurations[GAP_TRACKING_LENGTH+1]
uint32_t totalTriggerErrorCounter
bool isSyncPoint(const TriggerWaveform &triggerShape, trigger_type_e triggerType) const
bool getShaftSynchronized() const
trigger_config_s getType() const override
bool isVerboseTriggerSynchDetails() const override
VvtTriggerConfiguration(const char *prefix, const int p_index)
void onTooManyTeeth(int actual, int expected) override
void onNotEnoughTeeth(int actual, int expected) override
VvtTriggerDecoder(const char *p_name)
triggerStateIndex("triggerStateIndex", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1584, 1.0, -1.0, -1.0, "")
virtual void OnTriggerStateProperState(efitick_t nowNt, size_t triggerStateIndex)=0
virtual void OnTriggerSynchronization(bool wasSynchronized, bool isDecodingError)=0
virtual void OnTriggerSynchronizationLost()=0
virtual TriggerStateListener * nextListener()=0
bool m_hasSynchronizedPhase
const char * getTrigger_value_e(TriggerValue value)
angle_t getEngineCycle(operation_mode_e operationMode)
const char * getTrigger_event_e(trigger_event_e value)