only:correcting method name

This commit is contained in:
rusefillc 2024-12-10 19:12:13 -05:00
parent bb082fa9c4
commit 526c9f7f7b
9 changed files with 18 additions and 18 deletions

View File

@ -25,7 +25,7 @@ static bool getAcrState() {
return false; return false;
} }
int revCount = getTriggerCentral()->triggerState.getCrankSynchronizationCounter(); int revCount = getTriggerCentral()->triggerState.getSynchronizationCounter();
if (revCount > engineConfiguration->acrRevolutions) { if (revCount > engineConfiguration->acrRevolutions) {
// Enough revs have elapsed that we're done with ACR // Enough revs have elapsed that we're done with ACR
return false; return false;

View File

@ -638,7 +638,7 @@ void TriggerCentral::decodeMapCam(efitick_t timestamp, float currentPhase) {
if (instantMapDiffBetweenReadoutAngles > engineConfiguration->mapSyncThreshold) { if (instantMapDiffBetweenReadoutAngles > engineConfiguration->mapSyncThreshold) {
mapVvt_sync_counter++; mapVvt_sync_counter++;
int revolutionCounter = getTriggerCentral()->triggerState.getCrankSynchronizationCounter(); int revolutionCounter = getTriggerCentral()->triggerState.getSynchronizationCounter();
mapVvt_MAP_AT_CYCLE_COUNT = revolutionCounter - prevChangeAtCycle; mapVvt_MAP_AT_CYCLE_COUNT = revolutionCounter - prevChangeAtCycle;
prevChangeAtCycle = revolutionCounter; prevChangeAtCycle = revolutionCounter;
@ -798,7 +798,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
* cycle into a four stroke, 720 degrees cycle. * cycle into a four stroke, 720 degrees cycle.
*/ */
int crankDivider = getCrankDivider(triggerShape.getWheelOperationMode()); int crankDivider = getCrankDivider(triggerShape.getWheelOperationMode());
int crankInternalIndex = triggerState.getCrankSynchronizationCounter() % crankDivider; int crankInternalIndex = triggerState.getSynchronizationCounter() % crankDivider;
int triggerIndexForListeners = decodeResult.Value.CurrentIndex + (crankInternalIndex * triggerShape.getSize()); int triggerIndexForListeners = decodeResult.Value.CurrentIndex + (crankInternalIndex * triggerShape.getSize());
reportEventToWaveChart(signal, triggerIndexForListeners, triggerShape.useOnlyRisingEdges); reportEventToWaveChart(signal, triggerIndexForListeners, triggerShape.useOnlyRisingEdges);
@ -847,7 +847,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
#if EFI_CDM_INTEGRATION #if EFI_CDM_INTEGRATION
if (trgEventIndex == 0 && isBrainPinValid(engineConfiguration->cdmInputPin)) { if (trgEventIndex == 0 && isBrainPinValid(engineConfiguration->cdmInputPin)) {
int cdmKnockValue = getCurrentCdmValue(getTriggerCentral()->triggerState.getCrankSynchronizationCounter()); int cdmKnockValue = getCurrentCdmValue(getTriggerCentral()->triggerState.getSynchronizationCounter());
engine->knockLogic(cdmKnockValue); engine->knockLogic(cdmKnockValue);
} }
#endif /* EFI_CDM_INTEGRATION */ #endif /* EFI_CDM_INTEGRATION */
@ -932,7 +932,7 @@ void triggerInfo(void) {
boolToString(tc->isTriggerDecoderError()), boolToString(tc->isTriggerDecoderError()),
tc->triggerState.totalTriggerErrorCounter, tc->triggerState.totalTriggerErrorCounter,
tc->triggerState.orderingErrorCounter, tc->triggerState.orderingErrorCounter,
tc->triggerState.getCrankSynchronizationCounter(), tc->triggerState.getSynchronizationCounter(),
boolToString(tc->directSelfStimulation)); boolToString(tc->directSelfStimulation));
if (TRIGGER_WAVEFORM(isSynchronizationNeeded)) { if (TRIGGER_WAVEFORM(isSynchronizationNeeded)) {
@ -1050,7 +1050,7 @@ static void initVvtShape(TriggerWaveform& shape, const TriggerConfiguration& p_c
void TriggerCentral::validateCamVvtCounters() { void TriggerCentral::validateCamVvtCounters() {
// micro-optimized 'crankSynchronizationCounter % 256' // micro-optimized 'crankSynchronizationCounter % 256'
int camVvtValidationIndex = triggerState.getCrankSynchronizationCounter() & 0xFF; int camVvtValidationIndex = triggerState.getSynchronizationCounter() & 0xFF;
if (camVvtValidationIndex == 0) { if (camVvtValidationIndex == 0) {
vvtCamCounter = 0; vvtCamCounter = 0;
} else if (camVvtValidationIndex == 0xFE && vvtCamCounter < 60) { } else if (camVvtValidationIndex == 0xFE && vvtCamCounter < 60) {

View File

@ -168,7 +168,7 @@ int64_t TriggerDecoderBase::getTotalEventCounter() const {
return totalEventCountBase + currentCycle.current_index; return totalEventCountBase + currentCycle.current_index;
} }
int TriggerDecoderBase::getCrankSynchronizationCounter() const { int TriggerDecoderBase::getSynchronizationCounter() const {
return crankSynchronizationCounter; 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, divider > 1, "syncEnginePhase divider", false);
efiAssert(ObdCode::OBD_PCM_Processor_Fault, remainder < divider, "syncEnginePhase remainder", false); efiAssert(ObdCode::OBD_PCM_Processor_Fault, remainder < divider, "syncEnginePhase remainder", false);
angle_t totalShift = 0; 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 * 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 * 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 // 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 EFI_UNIT_TEST
if (printTriggerDebug) { if (printTriggerDebug) {

View File

@ -86,7 +86,7 @@ public:
* current trigger processing index, between zero and #size * current trigger processing index, between zero and #size
*/ */
int getCurrentIndex() const; int getCurrentIndex() const;
int getCrankSynchronizationCounter() const; int getSynchronizationCounter() const;
/** /**
* this is important for crank-based virtual trigger and VVT magic * this is important for crank-based virtual trigger and VVT magic
*/ */

View File

@ -108,7 +108,7 @@ void TriggerStimulatorHelper::assertSyncPosition(
feedSimulatedEvent(triggerConfiguration, state, shape, i); feedSimulatedEvent(triggerConfiguration, state, shape, i);
} }
int revolutionCounter = state.getCrankSynchronizationCounter(); int revolutionCounter = state.getSynchronizationCounter();
if (revolutionCounter != TEST_REVOLUTIONS) { if (revolutionCounter != TEST_REVOLUTIONS) {
warning(ObdCode::CUSTOM_OBD_TRIGGER_WAVEFORM, "sync failed/wrong gap parameters trigger=%s revolutionCounter=%d", warning(ObdCode::CUSTOM_OBD_TRIGGER_WAVEFORM, "sync failed/wrong gap parameters trigger=%s revolutionCounter=%d",
getTrigger_type_e(triggerConfiguration.TriggerType.type), getTrigger_type_e(triggerConfiguration.TriggerType.type),

View File

@ -68,7 +68,7 @@ static void extIonCallback(void *arg) {
UNUSED(arg); UNUSED(arg);
instance.totalCdmEvents++; instance.totalCdmEvents++;
int currentRevolution = engine->triggerCentral.triggerState.getCrankSynchronizationCounter(); int currentRevolution = engine->triggerCentral.triggerState.getSynchronizationCounter();
instance.onNewSignal(currentRevolution); instance.onNewSignal(currentRevolution);
} }

View File

@ -150,7 +150,7 @@ TEST(trigger, testNB2CamInput) {
// need to be out of VVT sync to see VVT sync in action // need to be out of VVT sync to see VVT sync in action
eth.fireRise(25 * 70 / 180); eth.fireRise(25 * 70 / 180);
eth.fireRise(25 * 110 / 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); ASSERT_TRUE((totalRevolutionCountBeforeVvtSync % SYMMETRICAL_CRANK_SENSOR_DIVIDER) != 0);
eth.moveTimeForwardUs(MS2US(3)); // shifting VVT phase a few angles eth.moveTimeForwardUs(MS2US(3)); // shifting VVT phase a few angles
@ -172,7 +172,7 @@ TEST(trigger, testNB2CamInput) {
hwHandleVvtCamSignal(true, getTimeNowNt(), 0); hwHandleVvtCamSignal(true, getTimeNowNt(), 0);
ASSERT_FLOAT_EQ(0, engine->triggerCentral.getVVTPosition(0, 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 // Third gap - long
@ -183,7 +183,7 @@ TEST(trigger, testNB2CamInput) {
EXPECT_NEAR(290.5f, engine->triggerCentral.getVVTPosition(0, 0), EPS2D); EXPECT_NEAR(290.5f, engine->triggerCentral.getVVTPosition(0, 0), EPS2D);
// actually position based on VVT! // 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()); EXPECT_EQ(40, waveChart.getSize());
} }

View File

@ -76,7 +76,7 @@ static void runTriggerTest(const char *fileName, int totalErrors, int syncCounte
} }
ASSERT_TRUE(gotRpm); ASSERT_TRUE(gotRpm);
ASSERT_EQ(totalErrors, engine->triggerCentral.triggerState.totalTriggerErrorCounter); ASSERT_EQ(totalErrors, engine->triggerCentral.triggerState.totalTriggerErrorCounter);
ASSERT_EQ(syncCounter, engine->triggerCentral.triggerState.getCrankSynchronizationCounter()); ASSERT_EQ(syncCounter, engine->triggerCentral.triggerState.getSynchronizationCounter());
} }

View File

@ -109,7 +109,7 @@ TEST(TriggerDecoder, FindsSyncPointMultipleRevolutions) {
doTooth(dut, shape, cfg, t); doTooth(dut, shape, cfg, t);
EXPECT_TRUE(dut.getShaftSynchronized()); EXPECT_TRUE(dut.getShaftSynchronized());
EXPECT_EQ(0, dut.currentCycle.current_index); 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 // Do 100 turns and make sure we stay synchronized
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
@ -131,7 +131,7 @@ TEST(TriggerDecoder, FindsSyncPointMultipleRevolutions) {
EXPECT_FALSE(dut.someSortOfTriggerError()); EXPECT_FALSE(dut.someSortOfTriggerError());
// We do one revolution per loop iteration // We do one revolution per loop iteration
EXPECT_EQ(i + 1, dut.getCrankSynchronizationCounter()); EXPECT_EQ(i + 1, dut.getSynchronizationCounter());
} }
} }