From b69292540be55c6279af32155d340ed1c16e6f9c Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 2 Dec 2021 17:06:06 -0500 Subject: [PATCH] Engine phase wrap around in log #3645 hopefully actual fix --- firmware/console/status_loop.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 3be5b3a194..7b226983b2 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -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; }