From eabf290e7cf792c5cbbed2e454f6b5a4772135f9 Mon Sep 17 00:00:00 2001 From: Joseph Coffland Date: Mon, 17 Dec 2018 16:17:21 -0800 Subject: [PATCH] Fixed pause fail in long run due to planner ID wrap around --- src/py/bbctrl/CommandQueue.py | 2 +- src/py/bbctrl/Planner.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/py/bbctrl/CommandQueue.py b/src/py/bbctrl/CommandQueue.py index 25bc6b7..ee20ee8 100644 --- a/src/py/bbctrl/CommandQueue.py +++ b/src/py/bbctrl/CommandQueue.py @@ -33,7 +33,7 @@ log.setLevel(logging.WARNING) # 16-bit less with wrap around -def id_less(a, b): return (1 << 15) < (a - b) % ((1 << 16) - 1) +def id_less(a, b): return (1 << 15) < (a - b) & ((1 << 16) - 1) class CommandQueue(): diff --git a/src/py/bbctrl/Planner.py b/src/py/bbctrl/Planner.py index 43407f4..fc6e7e9 100644 --- a/src/py/bbctrl/Planner.py +++ b/src/py/bbctrl/Planner.py @@ -270,10 +270,6 @@ class Planner(): def _encode(self, block): - # Handle id wrapping by restricting ids to 16-bit - # See CommandQueue id_less() - block['id'] %= (1 << 16) - 1 - cmd = self.__encode(block) if cmd is not None: -- 2.27.0