minor bugfix

This commit is contained in:
rusefi 2017-12-02 18:57:52 -05:00
parent 8399edc80b
commit 06e522a4f0
1 changed files with 8 additions and 6 deletions

View File

@ -239,13 +239,15 @@ static void reportWave(Logging *logging, int index) {
uint32_t offsetUs = getWaveOffset(index);
int rpm = getRpmE(engine);
float oneDegreeUs = rpm == 0 ? NAN : getOneDegreeTimeUs(rpm);
if (rpm != 0) {
float oneDegreeUs = getOneDegreeTimeUs(rpm);
appendPrintf(logging, "advance%d%s", index, DELIMETER);
float angle = (offsetUs / oneDegreeUs) - tdcPosition();
fixAngle(angle, "angle");
appendFloat(logging, angle, 3);
appendPrintf(logging, "%s", DELIMETER);
appendPrintf(logging, "advance%d%s", index, DELIMETER);
float angle = (offsetUs / oneDegreeUs) - tdcPosition();
fixAngle(angle, "waveAn");
appendFloat(logging, angle, 3);
appendPrintf(logging, "%s", DELIMETER);
}
}
}