Matt has CUSTOM_ERR_VVT_OUT_OF_RANGE warning #2921
This commit is contained in:
parent
fd6cfe7965
commit
0aa8693f21
|
@ -378,6 +378,16 @@ void EngineTestHelper::setTriggerType(trigger_type_e trigger DECLARE_ENGINE_PARA
|
||||||
applyTriggerWaveform();
|
applyTriggerWaveform();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EngineTestHelper::executeUntil(int timeUs) {
|
||||||
|
scheduling_s *head;
|
||||||
|
while ((head = engine.executor.getHead()) != nullptr) {
|
||||||
|
if (head->momentX > timeUs) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
setTimeAndInvokeEventsUs(head->momentX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injectionMode) {
|
void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injectionMode) {
|
||||||
setupSimpleTestEngineWithMaf(eth, injectionMode, TT_ONE);
|
setupSimpleTestEngineWithMaf(eth, injectionMode, TT_ONE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
void smartFireFall(float delayMs);
|
void smartFireFall(float delayMs);
|
||||||
void moveTimeForwardAndInvokeEventsUs(int deltaTimeUs);
|
void moveTimeForwardAndInvokeEventsUs(int deltaTimeUs);
|
||||||
void setTimeAndInvokeEventsUs(int timeNowUs);
|
void setTimeAndInvokeEventsUs(int timeNowUs);
|
||||||
|
void executeUntil(int timeUs);
|
||||||
void moveTimeForwardAndInvokeEventsSec(int deltaTimeSeconds);
|
void moveTimeForwardAndInvokeEventsSec(int deltaTimeSeconds);
|
||||||
void smartFireTriggerEvents2(int count, float delayMs);
|
void smartFireTriggerEvents2(int count, float delayMs);
|
||||||
|
|
||||||
|
|
|
@ -108,17 +108,25 @@ TEST(nissan, vq_vvt) {
|
||||||
PASS_ENGINE_PARAMETER_SUFFIX);
|
PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eth.executeUntil(1473000);
|
||||||
|
ASSERT_EQ(0, GET_RPM());
|
||||||
|
|
||||||
|
eth.executeUntil(1475000);
|
||||||
|
ASSERT_EQ(167, GET_RPM());
|
||||||
|
TriggerCentral *tc = &engine->triggerCentral;
|
||||||
|
|
||||||
|
eth.executeUntil(3593000);
|
||||||
|
ASSERT_TRUE(tc->vvtState[0][0].getShaftSynchronized());
|
||||||
|
|
||||||
scheduling_s *head;
|
scheduling_s *head;
|
||||||
while ((head = engine->executor.getHead()) != nullptr) {
|
while ((head = engine->executor.getHead()) != nullptr) {
|
||||||
eth.setTimeAndInvokeEventsUs(head->momentX);
|
eth.setTimeAndInvokeEventsUs(head->momentX);
|
||||||
}
|
|
||||||
|
|
||||||
ASSERT_EQ(167, GET_RPM());
|
|
||||||
|
|
||||||
TriggerCentral *tc = &engine->triggerCentral;
|
|
||||||
|
|
||||||
|
|
||||||
ASSERT_TRUE(tc->vvtState[0][0].getShaftSynchronized());
|
ASSERT_TRUE(tc->vvtState[0][0].getShaftSynchronized());
|
||||||
|
// let's celebrate that vvtPosition stays the same
|
||||||
|
ASSERT_NEAR(-testVvtOffset, tc->vvtPosition[0][0], EPS2D);
|
||||||
|
}
|
||||||
|
|
||||||
ASSERT_TRUE(tc->vvtState[1][0].getShaftSynchronized());
|
ASSERT_TRUE(tc->vvtState[1][0].getShaftSynchronized());
|
||||||
|
|
||||||
ASSERT_NEAR(-testVvtOffset, tc->vvtPosition[0][0], EPS2D);
|
ASSERT_NEAR(-testVvtOffset, tc->vvtPosition[0][0], EPS2D);
|
||||||
|
|
Loading…
Reference in New Issue