Engine phase wrap around in log #3645

hopefully actual fix
This commit is contained in:
rusefillc 2021-12-02 17:06:06 -05:00
parent 9ce37314c0
commit b69292540b
1 changed files with 3 additions and 1 deletions

View File

@ -874,7 +874,9 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels) {
void updateCurrentEnginePhase() {
if (auto phase = engine->triggerCentral.getCurrentEnginePhase(getTimeNowNt())) {
tsOutputChannels.currentEnginePhase = phase.Value - tdcPosition();
angle_t angle = phase.Value - tdcPosition();
wrapAngle(angle, "updateCurrentEnginePhase", CUSTOM_ERR_6555);
tsOutputChannels.currentEnginePhase = angle;
} else {
tsOutputChannels.currentEnginePhase = 0;
}