no need for getTimeNowUs on ETH
This commit is contained in:
parent
4744515cf5
commit
b5e3694647
|
@ -278,10 +278,6 @@ void EngineTestHelper::setTimeAndInvokeEventsUs(int targetTime) {
|
||||||
timeNowUs = targetTime;
|
timeNowUs = targetTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
efitimeus_t EngineTestHelper::getTimeNowUs() {
|
|
||||||
return timeNowUs;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EngineTestHelper::fireTriggerEvents(int count) {
|
void EngineTestHelper::fireTriggerEvents(int count) {
|
||||||
fireTriggerEvents2(count, 5); // 5ms
|
fireTriggerEvents2(count, 5); // 5ms
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,6 @@ public:
|
||||||
int executeActions();
|
int executeActions();
|
||||||
void moveTimeForwardMs(float deltaTimeMs);
|
void moveTimeForwardMs(float deltaTimeMs);
|
||||||
void moveTimeForwardSec(float deltaTimeSec);
|
void moveTimeForwardSec(float deltaTimeSec);
|
||||||
efitimeus_t getTimeNowUs();
|
|
||||||
|
|
||||||
Engine engine;
|
Engine engine;
|
||||||
persistent_config_s persistentConfig;
|
persistent_config_s persistentConfig;
|
||||||
|
|
|
@ -54,7 +54,7 @@ TEST(OddFireRunningMode, hd) {
|
||||||
|
|
||||||
eth.assertRpm( 500, "spinning-RPM#1");
|
eth.assertRpm( 500, "spinning-RPM#1");
|
||||||
|
|
||||||
engine->executor.executeAll(eth.getTimeNowUs() + MS2US(1000000));
|
engine->executor.executeAll(getTimeNowUs() + MS2US(1000000));
|
||||||
|
|
||||||
eth.fireTriggerEvents2(2 /* count */ , 60 /* ms */);
|
eth.fireTriggerEvents2(2 /* count */ , 60 /* ms */);
|
||||||
ASSERT_EQ(IM_SEQUENTIAL, getCurrentInjectionMode());
|
ASSERT_EQ(IM_SEQUENTIAL, getCurrentInjectionMode());
|
||||||
|
|
|
@ -222,7 +222,7 @@ TEST(misc, testRpmCalculator) {
|
||||||
|
|
||||||
eth.moveTimeForwardMs(5 /*ms*/);
|
eth.moveTimeForwardMs(5 /*ms*/);
|
||||||
|
|
||||||
int start = eth.getTimeNowUs();
|
int start = getTimeNowUs();
|
||||||
ASSERT_EQ( 485000, start) << "start value";
|
ASSERT_EQ( 485000, start) << "start value";
|
||||||
|
|
||||||
engine->periodicFastCallback();
|
engine->periodicFastCallback();
|
||||||
|
@ -928,11 +928,11 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) {
|
||||||
// assertInjectorDownEvent("L04@8", 8, MS2US(50.0), 0);
|
// assertInjectorDownEvent("L04@8", 8, MS2US(50.0), 0);
|
||||||
|
|
||||||
|
|
||||||
engine->executor.executeAll(eth.getTimeNowUs() + 1);
|
engine->executor.executeAll(getTimeNowUs() + 1);
|
||||||
// injector goes high...
|
// injector goes high...
|
||||||
ASSERT_FALSE(enginePins.injectors[0].currentLogicValue) << "injector@1";
|
ASSERT_FALSE(enginePins.injectors[0].currentLogicValue) << "injector@1";
|
||||||
|
|
||||||
engine->executor.executeAll(eth.getTimeNowUs() + MS2US(17.5) + 1);
|
engine->executor.executeAll(getTimeNowUs() + MS2US(17.5) + 1);
|
||||||
// injector does not go low too soon, that's a feature :)
|
// injector does not go low too soon, that's a feature :)
|
||||||
ASSERT_TRUE(enginePins.injectors[0].currentLogicValue) << "injector@2";
|
ASSERT_TRUE(enginePins.injectors[0].currentLogicValue) << "injector@2";
|
||||||
|
|
||||||
|
@ -948,7 +948,7 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) {
|
||||||
//todo assertInjectorDownEvent("L015@5", 5, MS2US(30), 0);
|
//todo assertInjectorDownEvent("L015@5", 5, MS2US(30), 0);
|
||||||
|
|
||||||
|
|
||||||
engine->executor.executeAll(eth.getTimeNowUs() + MS2US(10) + 1);
|
engine->executor.executeAll(getTimeNowUs() + MS2US(10) + 1);
|
||||||
// end of combined injection
|
// end of combined injection
|
||||||
ASSERT_FALSE(enginePins.injectors[0].currentLogicValue) << "injector@3";
|
ASSERT_FALSE(enginePins.injectors[0].currentLogicValue) << "injector@3";
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ static void simulateTrigger(EngineTestHelper ð, TriggerAdcDetector &trigAdcSt
|
||||||
static const float Vil = 0.3f * adcMaxVoltage;
|
static const float Vil = 0.3f * adcMaxVoltage;
|
||||||
static const float Vih = 0.7f * adcMaxVoltage;
|
static const float Vih = 0.7f * adcMaxVoltage;
|
||||||
|
|
||||||
efitimeus_t startUs = eth.getTimeNowUs();
|
efitimeus_t startUs = getTimeNowUs();
|
||||||
|
|
||||||
int prevLogicValue = -1;
|
int prevLogicValue = -1;
|
||||||
while (reader.haveMore()) {
|
while (reader.haveMore()) {
|
||||||
|
|
Loading…
Reference in New Issue