From 526c9f7f7b0d922eaef1ae7222786f5031402bee Mon Sep 17 00:00:00 2001 From: rusefillc Date: Tue, 10 Dec 2024 19:12:13 -0500 Subject: [PATCH] only:correcting method name --- firmware/controllers/actuators/harley_acr.cpp | 2 +- firmware/controllers/trigger/trigger_central.cpp | 10 +++++----- firmware/controllers/trigger/trigger_decoder.cpp | 6 +++--- firmware/controllers/trigger/trigger_decoder.h | 2 +- firmware/controllers/trigger/trigger_simulator.cpp | 2 +- firmware/hw_layer/cdm_ion_sense.cpp | 2 +- unit_tests/tests/trigger/test_cam_vvt_input.cpp | 6 +++--- unit_tests/tests/trigger/test_real_6g72_3000gt.cpp | 2 +- unit_tests/tests/trigger/test_trigger_decoder_2.cpp | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/firmware/controllers/actuators/harley_acr.cpp b/firmware/controllers/actuators/harley_acr.cpp index 2eaf6b1911..61595b35fd 100644 --- a/firmware/controllers/actuators/harley_acr.cpp +++ b/firmware/controllers/actuators/harley_acr.cpp @@ -25,7 +25,7 @@ static bool getAcrState() { return false; } - int revCount = getTriggerCentral()->triggerState.getCrankSynchronizationCounter(); + int revCount = getTriggerCentral()->triggerState.getSynchronizationCounter(); if (revCount > engineConfiguration->acrRevolutions) { // Enough revs have elapsed that we're done with ACR return false; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 6763f6a1d0..110a71d457 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -638,7 +638,7 @@ void TriggerCentral::decodeMapCam(efitick_t timestamp, float currentPhase) { if (instantMapDiffBetweenReadoutAngles > engineConfiguration->mapSyncThreshold) { mapVvt_sync_counter++; - int revolutionCounter = getTriggerCentral()->triggerState.getCrankSynchronizationCounter(); + int revolutionCounter = getTriggerCentral()->triggerState.getSynchronizationCounter(); mapVvt_MAP_AT_CYCLE_COUNT = revolutionCounter - prevChangeAtCycle; prevChangeAtCycle = revolutionCounter; @@ -798,7 +798,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta * cycle into a four stroke, 720 degrees cycle. */ int crankDivider = getCrankDivider(triggerShape.getWheelOperationMode()); - int crankInternalIndex = triggerState.getCrankSynchronizationCounter() % crankDivider; + int crankInternalIndex = triggerState.getSynchronizationCounter() % crankDivider; int triggerIndexForListeners = decodeResult.Value.CurrentIndex + (crankInternalIndex * triggerShape.getSize()); reportEventToWaveChart(signal, triggerIndexForListeners, triggerShape.useOnlyRisingEdges); @@ -847,7 +847,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta #if EFI_CDM_INTEGRATION if (trgEventIndex == 0 && isBrainPinValid(engineConfiguration->cdmInputPin)) { - int cdmKnockValue = getCurrentCdmValue(getTriggerCentral()->triggerState.getCrankSynchronizationCounter()); + int cdmKnockValue = getCurrentCdmValue(getTriggerCentral()->triggerState.getSynchronizationCounter()); engine->knockLogic(cdmKnockValue); } #endif /* EFI_CDM_INTEGRATION */ @@ -932,7 +932,7 @@ void triggerInfo(void) { boolToString(tc->isTriggerDecoderError()), tc->triggerState.totalTriggerErrorCounter, tc->triggerState.orderingErrorCounter, - tc->triggerState.getCrankSynchronizationCounter(), + tc->triggerState.getSynchronizationCounter(), boolToString(tc->directSelfStimulation)); if (TRIGGER_WAVEFORM(isSynchronizationNeeded)) { @@ -1050,7 +1050,7 @@ static void initVvtShape(TriggerWaveform& shape, const TriggerConfiguration& p_c void TriggerCentral::validateCamVvtCounters() { // micro-optimized 'crankSynchronizationCounter % 256' - int camVvtValidationIndex = triggerState.getCrankSynchronizationCounter() & 0xFF; + int camVvtValidationIndex = triggerState.getSynchronizationCounter() & 0xFF; if (camVvtValidationIndex == 0) { vvtCamCounter = 0; } else if (camVvtValidationIndex == 0xFE && vvtCamCounter < 60) { diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 55c6cb6dab..00e546103b 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -168,7 +168,7 @@ int64_t TriggerDecoderBase::getTotalEventCounter() const { return totalEventCountBase + currentCycle.current_index; } -int TriggerDecoderBase::getCrankSynchronizationCounter() const { +int TriggerDecoderBase::getSynchronizationCounter() const { return crankSynchronizationCounter; } @@ -209,7 +209,7 @@ angle_t PrimaryTriggerDecoder::syncEnginePhase(int divider, int remainder, angle efiAssert(ObdCode::OBD_PCM_Processor_Fault, divider > 1, "syncEnginePhase divider", false); efiAssert(ObdCode::OBD_PCM_Processor_Fault, remainder < divider, "syncEnginePhase remainder", false); angle_t totalShift = 0; - while (getCrankSynchronizationCounter() % divider != remainder) { + while (getSynchronizationCounter() % divider != remainder) { /** * we are here if we've detected the cam sensor within the wrong crank phase * let's increase the trigger event counter, that would adjust the state of @@ -708,7 +708,7 @@ uint32_t TriggerDecoderBase::findTriggerZeroEventIndex( } // Assert that we found the sync point on the very first revolution - efiAssert(ObdCode::CUSTOM_ERR_ASSERT, getCrankSynchronizationCounter() == 0, "findZero_revCounter", EFI_ERROR_CODE); + efiAssert(ObdCode::CUSTOM_ERR_ASSERT, getSynchronizationCounter() == 0, "findZero_revCounter", EFI_ERROR_CODE); #if EFI_UNIT_TEST if (printTriggerDebug) { diff --git a/firmware/controllers/trigger/trigger_decoder.h b/firmware/controllers/trigger/trigger_decoder.h index ade027aedc..9f4047d5d7 100644 --- a/firmware/controllers/trigger/trigger_decoder.h +++ b/firmware/controllers/trigger/trigger_decoder.h @@ -86,7 +86,7 @@ public: * current trigger processing index, between zero and #size */ int getCurrentIndex() const; - int getCrankSynchronizationCounter() const; + int getSynchronizationCounter() const; /** * this is important for crank-based virtual trigger and VVT magic */ diff --git a/firmware/controllers/trigger/trigger_simulator.cpp b/firmware/controllers/trigger/trigger_simulator.cpp index 15873c6238..72233db2f2 100644 --- a/firmware/controllers/trigger/trigger_simulator.cpp +++ b/firmware/controllers/trigger/trigger_simulator.cpp @@ -108,7 +108,7 @@ void TriggerStimulatorHelper::assertSyncPosition( feedSimulatedEvent(triggerConfiguration, state, shape, i); } - int revolutionCounter = state.getCrankSynchronizationCounter(); + int revolutionCounter = state.getSynchronizationCounter(); if (revolutionCounter != TEST_REVOLUTIONS) { warning(ObdCode::CUSTOM_OBD_TRIGGER_WAVEFORM, "sync failed/wrong gap parameters trigger=%s revolutionCounter=%d", getTrigger_type_e(triggerConfiguration.TriggerType.type), diff --git a/firmware/hw_layer/cdm_ion_sense.cpp b/firmware/hw_layer/cdm_ion_sense.cpp index 67ec408509..f7ee8a0dae 100644 --- a/firmware/hw_layer/cdm_ion_sense.cpp +++ b/firmware/hw_layer/cdm_ion_sense.cpp @@ -68,7 +68,7 @@ static void extIonCallback(void *arg) { UNUSED(arg); instance.totalCdmEvents++; - int currentRevolution = engine->triggerCentral.triggerState.getCrankSynchronizationCounter(); + int currentRevolution = engine->triggerCentral.triggerState.getSynchronizationCounter(); instance.onNewSignal(currentRevolution); } diff --git a/unit_tests/tests/trigger/test_cam_vvt_input.cpp b/unit_tests/tests/trigger/test_cam_vvt_input.cpp index bcdcb8846f..28fbeded08 100644 --- a/unit_tests/tests/trigger/test_cam_vvt_input.cpp +++ b/unit_tests/tests/trigger/test_cam_vvt_input.cpp @@ -150,7 +150,7 @@ TEST(trigger, testNB2CamInput) { // need to be out of VVT sync to see VVT sync in action eth.fireRise(25 * 70 / 180); eth.fireRise(25 * 110 / 180); - ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getCrankSynchronizationCounter()); + ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getSynchronizationCounter()); ASSERT_TRUE((totalRevolutionCountBeforeVvtSync % SYMMETRICAL_CRANK_SENSOR_DIVIDER) != 0); eth.moveTimeForwardUs(MS2US(3)); // shifting VVT phase a few angles @@ -172,7 +172,7 @@ TEST(trigger, testNB2CamInput) { hwHandleVvtCamSignal(true, getTimeNowNt(), 0); ASSERT_FLOAT_EQ(0, engine->triggerCentral.getVVTPosition(0, 0)); - ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getCrankSynchronizationCounter()); + ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getSynchronizationCounter()); // Third gap - long @@ -183,7 +183,7 @@ TEST(trigger, testNB2CamInput) { EXPECT_NEAR(290.5f, engine->triggerCentral.getVVTPosition(0, 0), EPS2D); // actually position based on VVT! - ASSERT_EQ(totalRevolutionCountBeforeVvtSync + 3, engine->triggerCentral.triggerState.getCrankSynchronizationCounter()); + ASSERT_EQ(totalRevolutionCountBeforeVvtSync + 3, engine->triggerCentral.triggerState.getSynchronizationCounter()); EXPECT_EQ(40, waveChart.getSize()); } diff --git a/unit_tests/tests/trigger/test_real_6g72_3000gt.cpp b/unit_tests/tests/trigger/test_real_6g72_3000gt.cpp index 03c9569751..b239b9bf27 100644 --- a/unit_tests/tests/trigger/test_real_6g72_3000gt.cpp +++ b/unit_tests/tests/trigger/test_real_6g72_3000gt.cpp @@ -76,7 +76,7 @@ static void runTriggerTest(const char *fileName, int totalErrors, int syncCounte } ASSERT_TRUE(gotRpm); ASSERT_EQ(totalErrors, engine->triggerCentral.triggerState.totalTriggerErrorCounter); - ASSERT_EQ(syncCounter, engine->triggerCentral.triggerState.getCrankSynchronizationCounter()); + ASSERT_EQ(syncCounter, engine->triggerCentral.triggerState.getSynchronizationCounter()); } diff --git a/unit_tests/tests/trigger/test_trigger_decoder_2.cpp b/unit_tests/tests/trigger/test_trigger_decoder_2.cpp index b8578435ab..bc3f6705c3 100644 --- a/unit_tests/tests/trigger/test_trigger_decoder_2.cpp +++ b/unit_tests/tests/trigger/test_trigger_decoder_2.cpp @@ -109,7 +109,7 @@ TEST(TriggerDecoder, FindsSyncPointMultipleRevolutions) { doTooth(dut, shape, cfg, t); EXPECT_TRUE(dut.getShaftSynchronized()); EXPECT_EQ(0, dut.currentCycle.current_index); - EXPECT_EQ(0, dut.getCrankSynchronizationCounter()); + EXPECT_EQ(0, dut.getSynchronizationCounter()); // Do 100 turns and make sure we stay synchronized for (int i = 0; i < 100; i++) { @@ -131,7 +131,7 @@ TEST(TriggerDecoder, FindsSyncPointMultipleRevolutions) { EXPECT_FALSE(dut.someSortOfTriggerError()); // We do one revolution per loop iteration - EXPECT_EQ(i + 1, dut.getCrankSynchronizationCounter()); + EXPECT_EQ(i + 1, dut.getSynchronizationCounter()); } }