trigger refactoring: instance RPM #4740

This commit is contained in:
Andrey 2022-11-06 11:12:20 -05:00
parent a5136a0eae
commit d75bf59cdc
3 changed files with 5 additions and 1 deletions

View File

@ -316,6 +316,8 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
// Always update instant RPM even when not spinning up
engine->triggerCentral.triggerState.instantRpm.updateInstantRpm(
engine->triggerCentral.triggerState.currentCycle.current_index,
engine->triggerCentral.triggerShape, &engine->triggerCentral.triggerFormDetails,
trgEventIndex, nowNt);

View File

@ -306,6 +306,7 @@ void InstantRpmCalculator::setLastEventTimeForInstantRpm(efitick_t nowNt) {
}
void InstantRpmCalculator::updateInstantRpm(
uint32_t current_index,
TriggerWaveform const & triggerShape, TriggerFormDetails *triggerFormDetails,
uint32_t index, efitick_t nowNt) {
@ -315,7 +316,7 @@ void InstantRpmCalculator::updateInstantRpm(
#if EFI_SENSOR_CHART
if (getEngineState()->sensorChartMode == SC_RPM_ACCEL || getEngineState()->sensorChartMode == SC_DETAILED_RPM) {
angle_t currentAngle = triggerFormDetails->eventAngles[currentCycle.current_index];
angle_t currentAngle = triggerFormDetails->eventAngles[current_index];
if (engineConfiguration->sensorChartMode == SC_DETAILED_RPM) {
scAddData(currentAngle, m_instantRpm);
} else {

View File

@ -191,6 +191,7 @@ public:
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
void updateInstantRpm(
uint32_t current_index,
TriggerWaveform const & triggerShape, TriggerFormDetails *triggerFormDetails,
uint32_t index, efitick_t nowNt);
#endif