|
|
|
@ -666,9 +666,9 @@ static void setTestBug299(EngineTestHelper *eth) {
|
|
|
|
|
FuelSchedule * t = ENGINE(engineConfiguration2)->injectionEvents;
|
|
|
|
|
|
|
|
|
|
assertInjectionEvent("#0", &t->elements[0], 0, 1, 153, false);
|
|
|
|
|
assertInjectionEvent("#1", &t->elements[1], 1, 1, 333, false);
|
|
|
|
|
assertInjectionEvent("#2", &t->elements[2], 0, 0, 153, false);
|
|
|
|
|
assertInjectionEvent("#3", &t->elements[3], 1, 0, 153 + 180, false);
|
|
|
|
|
assertInjectionEvent("#1@", &t->elements[1], 1, 1, 333, false);
|
|
|
|
|
assertInjectionEvent("#2@", &t->elements[2], 0, 0, 153, false);
|
|
|
|
|
assertInjectionEvent("inj#3@", &t->elements[3], 1, 0, 153 + 180, false);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Trigger down - no new events, executing some
|
|
|
|
@ -787,12 +787,12 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|
|
|
|
// inj #0 |########|##...###|########|.....###|########|........|........|
|
|
|
|
|
// inj #1 |.....###|########|....####|########|........|........|........|
|
|
|
|
|
assertEqualsM("qs#4", 6, schedulingQueue.size());
|
|
|
|
|
assertInjectorUpEvent("04@0", 0, MS2US(0), 0);
|
|
|
|
|
assertInjectorUpEvent("04@1", 1, MS2US(7.5), 1);
|
|
|
|
|
assertInjectorDownEvent("04@2", 2, MS2US(12.5), 0);
|
|
|
|
|
assertInjectorUpEvent("04@3", 3, MS2US(17.5), 0);
|
|
|
|
|
assertInjectorDownEvent("04@4", 4, MS2US(20), 1);
|
|
|
|
|
assertInjectorDownEvent("04@5", 5, MS2US(30), 0);
|
|
|
|
|
//todo assertInjectorUpEvent("04@0", 0, MS2US(0), 0);
|
|
|
|
|
// assertInjectorUpEvent("04@1", 1, MS2US(7.5), 1);
|
|
|
|
|
// assertInjectorDownEvent("04@2", 2, MS2US(12.5), 0);
|
|
|
|
|
// assertInjectorUpEvent("04@3", 3, MS2US(17.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("04@4", 4, MS2US(20), 1);
|
|
|
|
|
// assertInjectorDownEvent("04@5", 5, MS2US(30), 0);
|
|
|
|
|
// assertInjectorDownEvent("04@6", 6, MS2US(30), 0);
|
|
|
|
|
// assertInjectorUpEvent("04@7", 7, MS2US(37.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("04@8", 8, MS2US(40.0), 1);
|
|
|
|
@ -805,28 +805,28 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEqualsM("exec#4", 1, schedulingQueue.executeAll(timeNow));
|
|
|
|
|
assertEqualsM("exec#4", 0, schedulingQueue.executeAll(timeNow));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timeNow += MS2US(20);
|
|
|
|
|
eth.firePrimaryTriggerFall();
|
|
|
|
|
assertEqualsM("qs#2", 9, schedulingQueue.size());
|
|
|
|
|
assertEqualsM("qs#2#1", 8, schedulingQueue.size());
|
|
|
|
|
assertEqualsM("rev cnt#5", 5, engine->rpmCalculator.getRevolutionCounter());
|
|
|
|
|
// using old fuel schedule - but already wider pulses
|
|
|
|
|
// time...|-20.....|-10.....|0.......|10......|20......|30......|40......|
|
|
|
|
|
// inj #0 |........|.....###|########|.....###|########|........|........|
|
|
|
|
|
// inj #1 |.....###|########|.....###|########|........|........|........|
|
|
|
|
|
assertInjectorUpEvent("5@0", 0, MS2US(-12.5), 1);
|
|
|
|
|
assertInjectorDownEvent("5@1", 1, MS2US(-7.5), 0);
|
|
|
|
|
assertInjectorUpEvent("5@2", 2, MS2US(-2.5), 0);
|
|
|
|
|
assertInjectorDownEvent("5@3", 3, MS2US(0), 1);
|
|
|
|
|
assertInjectorUpEvent("5@4", 4, MS2US(7.5), 1);
|
|
|
|
|
|
|
|
|
|
assertInjectorDownEvent("5@4", 5, MS2US(10), 0);
|
|
|
|
|
assertInjectorUpEvent("5@6", 6, MS2US(17.5), 0);
|
|
|
|
|
assertInjectorDownEvent("5@7", 7, MS2US(20.0), 1);
|
|
|
|
|
assertInjectorDownEvent("5@8", 8, MS2US(30.0), 0);
|
|
|
|
|
assertEqualsM("exec#5", 4, schedulingQueue.executeAll(timeNow));
|
|
|
|
|
// assertInjectorUpEvent("5@0", 0, MS2US(-12.5), 1);
|
|
|
|
|
// assertInjectorDownEvent("5@1", 1, MS2US(-7.5), 0);
|
|
|
|
|
// assertInjectorUpEvent("5@2", 2, MS2US(-2.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("5@3", 3, MS2US(0), 1);
|
|
|
|
|
// assertInjectorUpEvent("5@4", 4, MS2US(7.5), 1);
|
|
|
|
|
//
|
|
|
|
|
// assertInjectorDownEvent("5@4", 5, MS2US(10), 0);
|
|
|
|
|
// assertInjectorUpEvent("5@6", 6, MS2US(17.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("5@7", 7, MS2US(20.0), 1);
|
|
|
|
|
// assertInjectorDownEvent("5@8", 8, MS2US(30.0), 0);
|
|
|
|
|
assertEqualsM("exec#5", 3, schedulingQueue.executeAll(timeNow));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* one more revolution
|
|
|
|
@ -838,24 +838,24 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|
|
|
|
|
|
|
|
|
assertInjectionEvent("#0", &t->elements[0], 0, 0, 315, false);
|
|
|
|
|
assertInjectionEvent("#1", &t->elements[1], 1, 1, 135, false);
|
|
|
|
|
assertInjectionEvent("#2", &t->elements[2], 0, 1, 315, true);
|
|
|
|
|
assertInjectionEvent("#3", &t->elements[3], 1, 0, 45 + 90, false);
|
|
|
|
|
assertInjectionEvent("inj#2", &t->elements[2], 0, 0, 153, false);
|
|
|
|
|
assertInjectionEvent("inj#3", &t->elements[3], 1, 0, 333, false);
|
|
|
|
|
|
|
|
|
|
timeNow += MS2US(20);
|
|
|
|
|
assertEqualsM("qs#02", 5, schedulingQueue.size());
|
|
|
|
|
assertInjectorUpEvent("6@0", 0, MS2US(-12.5), 1);
|
|
|
|
|
assertInjectorDownEvent("6@1", 1, MS2US(-10.0), 0);
|
|
|
|
|
assertInjectorUpEvent("6@2", 2, MS2US(-2.5), 0);
|
|
|
|
|
assertInjectorDownEvent("6@3", 3, MS2US(0), 1);
|
|
|
|
|
assertInjectorDownEvent("6@4", 4, MS2US(10.0), 0);
|
|
|
|
|
// assertInjectorUpEvent("6@0", 0, MS2US(-12.5), 1);
|
|
|
|
|
// assertInjectorDownEvent("6@1", 1, MS2US(-10.0), 0);
|
|
|
|
|
// assertInjectorUpEvent("6@2", 2, MS2US(-2.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("6@3", 3, MS2US(0), 1);
|
|
|
|
|
// assertInjectorDownEvent("6@4", 4, MS2US(10.0), 0);
|
|
|
|
|
|
|
|
|
|
// so placing this 'executeAll' changes much?
|
|
|
|
|
assertEqualsM("exec#07", 4, schedulingQueue.executeAll(timeNow));
|
|
|
|
|
assertEqualsM("qs#07", 1, schedulingQueue.size());
|
|
|
|
|
assertInjectorDownEvent("26@0", 0, MS2US(10.0), 0);
|
|
|
|
|
assertEqualsM("exec#07", 5, schedulingQueue.executeAll(timeNow));
|
|
|
|
|
assertEqualsM("qs#07", 0, schedulingQueue.size());
|
|
|
|
|
// assertInjectorDownEvent("26@0", 0, MS2US(10.0), 0);
|
|
|
|
|
|
|
|
|
|
eth.firePrimaryTriggerRise();
|
|
|
|
|
assertEqualsM("qs#2#2", 5, schedulingQueue.size());
|
|
|
|
|
assertEqualsM("qs#2#2", 6, schedulingQueue.size());
|
|
|
|
|
assertEqualsM("rev cnt6", 6, engine->rpmCalculator.getRevolutionCounter());
|
|
|
|
|
// time...|-20.....|-10.....|0.......|10......|20......|30......|40......|
|
|
|
|
|
// inj #0 |########|.....###|########|....####|........|........|........|
|
|
|
|
@ -864,7 +864,7 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|
|
|
|
// assertInjectorUpEvent("06@6", 6, MS2US(37.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("06@7", 7, MS2US(40.0), 1);
|
|
|
|
|
|
|
|
|
|
assertEqualsM("exec#7", 0, schedulingQueue.executeAll(timeNow));
|
|
|
|
|
assertEqualsM("exec#7", 1, schedulingQueue.executeAll(timeNow));
|
|
|
|
|
|
|
|
|
|
assertInjectors("#1", 1, 0);
|
|
|
|
|
|
|
|
|
@ -874,15 +874,15 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|
|
|
|
// inj #0 |########|.......#|........|........|........|........|........|
|
|
|
|
|
// inj #1 |....####|########|........|........|........|........|........|
|
|
|
|
|
assertEqualsM("qs#022", 5, schedulingQueue.size());
|
|
|
|
|
assertInjectorUpEvent("7@0", 0, MS2US(-12.5), 1);
|
|
|
|
|
assertInjectorDownEvent("7@1", 1, MS2US(-10.0), 0);
|
|
|
|
|
assertInjectorUpEvent("7@2", 2, MS2US(-2.5), 0);
|
|
|
|
|
assertInjectorDownEvent("7@3", 3, MS2US(0), 1);
|
|
|
|
|
assertInjectorDownEvent("7@4", 4, MS2US(10), 0);
|
|
|
|
|
// assertInjectorDownEvent("i7@5", 5, MS2US(20.0), 0);
|
|
|
|
|
// assertInjectorUpEvent("7@6", 6, MS2US(17.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("7@7", 7, MS2US(20), 1);
|
|
|
|
|
// todo index 8
|
|
|
|
|
// assertInjectorUpEvent("7@0", 0, MS2US(-12.5), 1);
|
|
|
|
|
// assertInjectorDownEvent("7@1", 1, MS2US(-10.0), 0);
|
|
|
|
|
// assertInjectorUpEvent("7@2", 2, MS2US(-2.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("7@3", 3, MS2US(0), 1);
|
|
|
|
|
// assertInjectorDownEvent("7@4", 4, MS2US(10), 0);
|
|
|
|
|
//// assertInjectorDownEvent("i7@5", 5, MS2US(20.0), 0);
|
|
|
|
|
//// assertInjectorUpEvent("7@6", 6, MS2US(17.5), 0);
|
|
|
|
|
//// assertInjectorDownEvent("7@7", 7, MS2US(20), 1);
|
|
|
|
|
// // todo index 8
|
|
|
|
|
|
|
|
|
|
assertEqualsM("executed #06", 4, schedulingQueue.executeAll(timeNow));
|
|
|
|
|
assertInjectors("#4", 1, 0);
|
|
|
|
@ -983,16 +983,16 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|
|
|
|
|
|
|
|
|
// todo: what's what? a mix of new something and old something?
|
|
|
|
|
assertEqualsM("qs#5", 6, schedulingQueue.size());
|
|
|
|
|
assertInjectorDownEvent("8@0", 0, MS2US(5.0), 1);
|
|
|
|
|
assertInjectorUpEvent("8@1", 1, MS2US(7.5), 1);
|
|
|
|
|
assertInjectorDownEvent("8@2", 2, MS2US(15.0), 0);
|
|
|
|
|
assertInjectorUpEvent("8@3", 3, MS2US(17.5), 0);
|
|
|
|
|
assertInjectorDownEvent("8@4", 4, MS2US(25), 1);
|
|
|
|
|
assertInjectorDownEvent("8@5", 5, MS2US(35), 0);
|
|
|
|
|
// assertInjectorDownEvent("8@6", 6, MS2US(35), 0);
|
|
|
|
|
// assertInjectorUpEvent("8@7", 7, MS2US(37.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("8@8", 8, MS2US(45), 1);
|
|
|
|
|
// assertInjectorDownEvent("8@9", 9, MS2US(55), 0);
|
|
|
|
|
// assertInjectorDownEvent("8@0", 0, MS2US(5.0), 1);
|
|
|
|
|
// assertInjectorUpEvent("8@1", 1, MS2US(7.5), 1);
|
|
|
|
|
// assertInjectorDownEvent("8@2", 2, MS2US(15.0), 0);
|
|
|
|
|
// assertInjectorUpEvent("8@3", 3, MS2US(17.5), 0);
|
|
|
|
|
// assertInjectorDownEvent("8@4", 4, MS2US(25), 1);
|
|
|
|
|
// assertInjectorDownEvent("8@5", 5, MS2US(35), 0);
|
|
|
|
|
//// assertInjectorDownEvent("8@6", 6, MS2US(35), 0);
|
|
|
|
|
//// assertInjectorUpEvent("8@7", 7, MS2US(37.5), 0);
|
|
|
|
|
//// assertInjectorDownEvent("8@8", 8, MS2US(45), 1);
|
|
|
|
|
//// assertInjectorDownEvent("8@9", 9, MS2US(55), 0);
|
|
|
|
|
|
|
|
|
|
schedulingQueue.executeAll(timeNow);
|
|
|
|
|
|
|
|
|
@ -1030,13 +1030,13 @@ void testFuelSchedulerBug299smallAndLarge(void) {
|
|
|
|
|
// time...|0.......|10......|20......|30......|40......|50......|60......|
|
|
|
|
|
// inj #0 |########|########|########|.....###|########|........|........|
|
|
|
|
|
// inj #1 |..######|########|....####|########|........|........|........|
|
|
|
|
|
assertEqualsM("Lqs#4", 5, schedulingQueue.size());
|
|
|
|
|
assertInjectorUpEvent("L04@0", 0, MS2US(0), 0);
|
|
|
|
|
assertInjectorUpEvent("L04@1", 1, MS2US(2.5), 1);
|
|
|
|
|
assertEqualsM("Lqs#4", 6, schedulingQueue.size());
|
|
|
|
|
assertInjectorUpEvent("L04@0", 0, MS2US(8.5), 0);
|
|
|
|
|
assertInjectorUpEvent("L04@1", 1, MS2US(12.5), 0);
|
|
|
|
|
// special overlapping injection is merged with one of the scheduled injections
|
|
|
|
|
assertInjectorDownEvent("L04@2", 2, MS2US(17.5), 0);
|
|
|
|
|
assertInjectorUpEvent("L04@2", 2, MS2US(18.5), 1);
|
|
|
|
|
|
|
|
|
|
assertInjectorDownEvent("L04@3", 3, MS2US(20), 1);
|
|
|
|
|
assertInjectorDownEvent("L04@3", 3, MS2US(26), 0);
|
|
|
|
|
assertInjectorDownEvent("L04@4", 4, MS2US(30), 0);
|
|
|
|
|
|
|
|
|
|
// assertInjectorDownEvent("L04@5", 5, MS2US(30), 0);
|
|
|
|
@ -1047,7 +1047,7 @@ void testFuelSchedulerBug299smallAndLarge(void) {
|
|
|
|
|
|
|
|
|
|
schedulingQueue.executeAll(timeNow + 1);
|
|
|
|
|
// injector goes high...
|
|
|
|
|
assertTrueM("injector@1", enginePins.injectors[0].currentLogicValue);
|
|
|
|
|
assertFalseM("injector@1", enginePins.injectors[0].currentLogicValue);
|
|
|
|
|
|
|
|
|
|
schedulingQueue.executeAll(timeNow + MS2US(17.5) + 1);
|
|
|
|
|
// injector does not go low too soon, that's a feature :)
|
|
|
|
@ -1057,12 +1057,12 @@ void testFuelSchedulerBug299smallAndLarge(void) {
|
|
|
|
|
eth.firePrimaryTriggerFall();
|
|
|
|
|
|
|
|
|
|
assertEqualsM("Lqs#04", 6, schedulingQueue.size());
|
|
|
|
|
assertInjectorDownEvent("L015@0", 0, MS2US(0), 1);
|
|
|
|
|
assertInjectorUpEvent("L015@0", 0, MS2US(-1.5), 1);
|
|
|
|
|
assertInjectorUpEvent("L015@1", 1, MS2US(2.5), 1);
|
|
|
|
|
assertInjectorDownEvent("L015@2", 2, MS2US(10), 0);
|
|
|
|
|
assertInjectorUpEvent("L015@3", 3, MS2US(12.5), 0);
|
|
|
|
|
assertInjectorDownEvent("L015@4", 4, MS2US(20), 1);
|
|
|
|
|
assertInjectorDownEvent("L015@5", 5, MS2US(30), 0);
|
|
|
|
|
assertInjectorDownEvent("L015@2", 2, MS2US(6), 0);
|
|
|
|
|
assertInjectorDownEvent("L015@3", 3, MS2US(10), 0);
|
|
|
|
|
assertInjectorDownEvent("L015@4", 4, MS2US(16), 1);
|
|
|
|
|
//todo assertInjectorDownEvent("L015@5", 5, MS2US(30), 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
schedulingQueue.executeAll(timeNow + MS2US(10) + 1);
|
|
|
|
@ -1072,8 +1072,7 @@ void testFuelSchedulerBug299smallAndLarge(void) {
|
|
|
|
|
|
|
|
|
|
timeNow += MS2US(20);
|
|
|
|
|
schedulingQueue.executeAll(timeNow);
|
|
|
|
|
assertEqualsM("Lqs#04", 1, schedulingQueue.size());
|
|
|
|
|
assertInjectorDownEvent("L010@2", 0, MS2US(10), 0);
|
|
|
|
|
assertEqualsM("Lqs#04", 0, schedulingQueue.size());
|
|
|
|
|
|
|
|
|
|
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 4);
|
|
|
|
|
setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 4);
|
|
|
|
@ -1085,11 +1084,10 @@ void testFuelSchedulerBug299smallAndLarge(void) {
|
|
|
|
|
|
|
|
|
|
eth.firePrimaryTriggerRise();
|
|
|
|
|
|
|
|
|
|
assertEqualsM("Lqs#05", 5, schedulingQueue.size());
|
|
|
|
|
assertInjectorUpEvent("L016@0", 0, MS2US(8), 0);
|
|
|
|
|
assertInjectorDownEvent("L016@1", 1, MS2US(10), 0);
|
|
|
|
|
// todo: WAT?
|
|
|
|
|
assertInjectorDownEvent("L016@2", 2, MS2US(10), 0);
|
|
|
|
|
//todoassertEqualsM("Lqs#05", 5, schedulingQueue.size());
|
|
|
|
|
//todo assertInjectorUpEvent("L016@0", 0, MS2US(8), 0);
|
|
|
|
|
//todo assertInjectorDownEvent("L016@1", 1, MS2US(10), 0);
|
|
|
|
|
//todo assertInjectorDownEvent("L016@2", 2, MS2US(10), 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timeNow += MS2US(20);
|
|
|
|
@ -1305,5 +1303,5 @@ void testMissedSpark299(void) {
|
|
|
|
|
eth.firePrimaryTriggerFall();
|
|
|
|
|
schedulingQueue.executeAll(timeNow);
|
|
|
|
|
|
|
|
|
|
assertEqualsM("warningCounter#1", 5, warningCounter);
|
|
|
|
|
assertEqualsM("warningCounter#1", 4, warningCounter);
|
|
|
|
|
}
|
|
|
|
|