14#if EFI_SHAFT_POSITION_INPUT
33 if (eventsToCopy >= triggerSize) {
48 uint32_t current_index, efitick_t nowNt) {
53 uint32_t nowNt32 = nowNt;
55 assertIsInBoundsWithResult(current_index,
timeOfLastEvent,
"calc timeOfLastEvent", 0);
65 angle_t previousAngle = currentAngle - 90;
67 int prevIndex = triggerShape.
findAngleIndex(triggerFormDetails, previousAngle);
78 uint32_t time = nowNt32 - time90ago;
79 angle_t angleDiff = currentAngle - prevIndexAngle;
89 float instantRpm = (60000000.0 / 360 * US_TO_NT_MULTIPLIER) * angleDiff / time;
90 assertIsInBoundsWithResult(current_index,
instantRpmValue,
"instantRpmValue", 0);
114 uint32_t nowNt32 = nowNt;
124 uint32_t current_index,
126 uint32_t index, efitick_t nowNt) {
size_t spinningEventIndex
void setLastEventTimeForInstantRpm(efitick_t nowNt)
uint32_t spinningEvents[120]
float instantRpmValue[PWM_PHASE_MAX_COUNT]
float calculateInstantRpm(TriggerWaveform const &triggerShape, TriggerFormDetails *triggerFormDetails, uint32_t index, efitick_t nowNt)
void movePreSynchTimestamps()
float prevInstantRpmValue
uint32_t timeOfLastEvent[PWM_PHASE_MAX_COUNT]
void updateInstantRpm(uint32_t current_index, TriggerWaveform const &triggerShape, TriggerFormDetails *triggerFormDetails, uint32_t index, efitick_t nowNt)
TriggerWaveform triggerShape
TriggerCentral * getTriggerCentral()
One header which acts as gateway to current engine state.
UNUSED(samplingTimeSeconds)
@ CUSTOM_ERR_TRIGGER_ANGLE_RANGE
@ OBD_PCM_Processor_Fault
instantRpm("sync: instant RPM", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 326, 1.0, 0.0, 0.0, "rpm")
void wrapAngle(angle_t &angle, const char *msg, ObdCode code)