only: syncEnginePhaseAndReport better method name

This commit is contained in:
rusEFI LLC 2024-05-06 13:44:12 -04:00
parent 48c2de91ed
commit d8f3e2c5f9
5 changed files with 15 additions and 7 deletions

View File

@ -131,7 +131,7 @@ static bool vvtWithRealDecoder(vvt_mode_e vvtMode) {
&& vvtMode != VVT_SINGLE_TOOTH;
}
angle_t TriggerCentral::syncAndReport(int divider, int remainder) {
angle_t TriggerCentral::syncEnginePhaseAndReport(int divider, int remainder) {
angle_t engineCycle = getEngineCycle(getEngineRotationState()->getOperationMode());
angle_t totalShift = triggerState.syncEnginePhase(divider, remainder, engineCycle);
@ -183,7 +183,7 @@ static angle_t adjustCrankPhase(int camIndex) {
case VVT_MAP_V_TWIN:
case VVT_MITSUBISHI_4G63:
case VVT_MITSUBISHI_4G9x:
return tc->syncAndReport(crankDivider, 1);
return tc->syncEnginePhaseAndReport(crankDivider, 1);
case VVT_SINGLE_TOOTH:
case VVT_NISSAN_VQ:
case VVT_BOSCH_QUICK_START:
@ -201,7 +201,7 @@ static angle_t adjustCrankPhase(int camIndex) {
case VVT_MITSUBISHI_6G75:
case VVT_HONDA_K_EXHAUST:
case VVT_HONDA_CBR_600:
return tc->syncAndReport(crankDivider, 0);
return tc->syncEnginePhaseAndReport(crankDivider, 0);
case VVT_HONDA_K_INTAKE:
// with 4 evenly spaced tooth we cannot use this wheel for engine sync
criticalError("Honda K Intake is not suitable for engine sync");

View File

@ -49,7 +49,12 @@ public:
class TriggerCentral final : public trigger_central_s {
public:
TriggerCentral();
angle_t syncAndReport(int divider, int remainder);
/**
* we have two kinds of sync:
* this method is about detecting of exact engine phase with 720 degree precision usually based on cam wheel decoding
* not to be confused with a totally different trigger _wheel_ sync which could be either crank wheel sync or cam wheel sync
*/
angle_t syncEnginePhaseAndReport(int divider, int remainder);
void handleShaftSignal(trigger_event_e signal, efitick_t timestamp);
int getHwEventCounter(int index) const;
void resetCounters();

View File

@ -197,6 +197,9 @@ public:
m_hasSynchronizedPhase = !m_needsDisambiguation;
}
/**
* returns zero if we were lucky to have correct engine phase, otherwise angle of engine phase correction which was applied.
*/
angle_t syncEnginePhase(int divider, int remainder, angle_t engineCycle);
// Returns true if syncEnginePhase has been called,

View File

@ -89,7 +89,7 @@ TEST(cranking, testFasterEngineSpinningUp) {
eth.assertEvent5("inj end#2", 1, (void*)endSimultaneousInjection, expectedSimultaneousTimestamp);
// Now perform a fake VVT sync and check that ignition mode changes to sequential
engine->triggerCentral.syncAndReport(2, 0);
engine->triggerCentral.syncEnginePhaseAndReport(2, 0);
ASSERT_EQ(IM_SEQUENTIAL, getCurrentIgnitionMode());
// still cranking fuel
ASSERT_NEAR(0.0039, getInjectionMass(200), EPS3D);

View File

@ -1015,7 +1015,7 @@ TEST(big, testSparkReverseOrderBug319) {
setConstantDwell(45);
engine->triggerCentral.syncAndReport(2, 0);
engine->triggerCentral.syncEnginePhaseAndReport(2, 0);
// this is needed to update injectorLag
engine->updateSlowSensors();
@ -1028,7 +1028,7 @@ TEST(big, testSparkReverseOrderBug319) {
eth.fireRise(20);
eth.fireFall(20);
engine->triggerCentral.syncAndReport(2, 0);
engine->triggerCentral.syncEnginePhaseAndReport(2, 0);
eth.executeActions();