From b3f9b3215b33796f0124e2701d521dacff155a6c Mon Sep 17 00:00:00 2001 From: Yannick Richter Date: Mon, 8 Apr 2024 11:44:41 +0200 Subject: [PATCH] BISS-C first packet sets lastPos Fixes one rotation offset with some startup positions --- Firmware/FFBoard/UserExtensions/Src/EncoderBissC.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Firmware/FFBoard/UserExtensions/Src/EncoderBissC.cpp b/Firmware/FFBoard/UserExtensions/Src/EncoderBissC.cpp index 55aa6ffc..bfae2357 100644 --- a/Firmware/FFBoard/UserExtensions/Src/EncoderBissC.cpp +++ b/Firmware/FFBoard/UserExtensions/Src/EncoderBissC.cpp @@ -41,6 +41,7 @@ EncoderBissC::EncoderBissC() : } void EncoderBissC::Run(){ + bool first = true; while(true){ requestNewDataSem.Take(); // Wait until a position is requested waitData = true; @@ -49,6 +50,10 @@ void EncoderBissC::Run(){ if(updateFrame()){ pos = newPos; + if(first){ // Prevent immediate multiturn update + lastPos = pos; + first = false; + } //handle multiturn if(pos-lastPos > 1<<(lenghtDataBit-1)){ mtpos--;