This commit is contained in:
Andrey 2024-04-12 16:48:55 -04:00 committed by rusefillc
parent 9fdb962ec6
commit f6c4f48c65
2 changed files with 4 additions and 3 deletions

View File

@ -76,6 +76,7 @@ public:
* [0, cylindersCount) * [0, cylindersCount)
*/ */
int cylinderIndex = 0; int cylinderIndex = 0;
// previously known as cylinderNumber
int8_t coilIndex = 0; int8_t coilIndex = 0;
char *name = nullptr; char *name = nullptr;
IgnitionOutputPin *getOutputForLoggins(); IgnitionOutputPin *getOutputForLoggins();

View File

@ -32,11 +32,11 @@ static void testNoOverdwell(const char* file, bool instantRpm) {
engine->onIgnitionEvent = [&](IgnitionEvent* event, bool state) { engine->onIgnitionEvent = [&](IgnitionEvent* event, bool state) {
if (state) { if (state) {
coilStartTimes[event->cylinderNumber] = getTimeNowNt(); coilStartTimes[event->coilIndex] = getTimeNowNt();
} else { } else {
auto actualDwell = 1e-3 * NT2USF(getTimeNowNt() - coilStartTimes[event->cylinderNumber]); auto actualDwell = 1e-3 * NT2USF(getTimeNowNt() - coilStartTimes[event->coilIndex]);
EXPECT_LT(actualDwell, 50) << "Overdwell on cylinder " << (int)event->cylinderNumber << " of " << actualDwell << " ms"; EXPECT_LT(actualDwell, 50) << "Overdwell on cylinder " << (int)event->coilIndex << " of " << actualDwell << " ms";
} }
}; };