Skip to content
Snippets Groups Projects
Commit 66b1b71a authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Fixed boolean bug, fixed number of states

parent 4fa925a0
No related branches found
No related tags found
1 merge request!2Resolve "Distance wrapping invalidates lock sum"
......@@ -33,7 +33,7 @@ end DistanceUnwrapper;
architecture Behavioral of DistanceUnwrapper is
type STATE_T is (IDLE_S, STATE1, STATE2, STATE3, STATE4, STATE5, STATE6);
type STATE_T is (IDLE_S, STATE1, STATE2, STATE3);
signal current_state : STATE_T := IDLE_S;
......@@ -102,7 +102,7 @@ begin
--calculate change to offset here
if calcDelta > maxDelta then
--we have wrapped around
if newIsLarger then
if newIsLarger = '1' then
--went negative
currentOffset <= currentOffset + corrDeltaN;
else
......@@ -116,7 +116,7 @@ begin
newIsLarger <= newIsLarger;
calcDelta <= calcDelta;
currentDistance <= currentDistance;
dr_out <= dr_out;
dr_out <= '0';
prevDistance <= prevDistance;
when STATE2 =>
......@@ -127,7 +127,7 @@ begin
newIsLarger <= newIsLarger;
calcDelta <= calcDelta;
currentOffset <= currentOffset;
dr_out <= dr_out;
dr_out <= '0';
prevDistance <= latchedDistance;
when STATE3 =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment