mirror of https://github.com/rusefi/rusefi.git
Overdwell at times around syncloss while cranking #6349
only: better handling of existing out-of-order handling
This commit is contained in:
parent
59e415728e
commit
6873974c0a
|
@ -31,10 +31,15 @@ static void testNoOverdwell(const char* file, bool instantRpm) {
|
||||||
std::vector<efitick_t> coilStartTimes(12);
|
std::vector<efitick_t> coilStartTimes(12);
|
||||||
|
|
||||||
engine->onIgnitionEvent = [&](IgnitionEvent* event, bool state) {
|
engine->onIgnitionEvent = [&](IgnitionEvent* event, bool state) {
|
||||||
|
efitick_t startTime = coilStartTimes[event->coilIndex];
|
||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
coilStartTimes[event->coilIndex] = getTimeNowNt();
|
coilStartTimes[event->coilIndex] = getTimeNowNt();
|
||||||
|
} else if (startTime == 0) {
|
||||||
|
printf("Interesting: goes LOW without ever going HIGH %d\n", event->coilIndex);
|
||||||
} else {
|
} else {
|
||||||
auto actualDwell = 1e-3 * NT2USF(getTimeNowNt() - coilStartTimes[event->coilIndex]);
|
auto actualDwell = 1e-3 * NT2USF(getTimeNowNt() - startTime);
|
||||||
|
coilStartTimes[event->coilIndex] = 0;
|
||||||
|
|
||||||
EXPECT_LT(actualDwell, 50) << "Overdwell on cylinder " << (int)event->coilIndex << " of " << actualDwell << " ms";
|
EXPECT_LT(actualDwell, 50) << "Overdwell on cylinder " << (int)event->coilIndex << " of " << actualDwell << " ms";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue