aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-11-14 18:36:42 -0500
committerKevin O'Connor <kevin@koconnor.net>2019-11-15 11:55:15 -0500
commit503891cd0ed787b117bf1f422dcbdebcdc07deb3 (patch)
treeae2fc4d041e1b87e6266a7e929790f3b5b55823d
parentdd529d7ad1f1522183d739bc23ee631a4d00feb0 (diff)
downloadkutter-503891cd0ed787b117bf1f422dcbdebcdc07deb3.tar.gz
kutter-503891cd0ed787b117bf1f422dcbdebcdc07deb3.tar.xz
kutter-503891cd0ed787b117bf1f422dcbdebcdc07deb3.zip
toolhead: Don't call _process_moves() if no moves present
Don't transition to the normal movement state if there aren't any moves actually ready to be processed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/toolhead.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index a2651fea..4855caf6 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -167,10 +167,12 @@ class MoveQueue:
return
# Allow extruder to do its lookahead
move_count = self.extruder_lookahead(queue, flush_count, lazy)
+ self.leftover = flush_count - move_count
+ if not move_count:
+ return
# Generate step times for all moves ready to be flushed
self.toolhead._process_moves(queue[:move_count])
# Remove processed moves from the queue
- self.leftover = flush_count - move_count
del queue[:move_count]
def add_move(self, move):
self.queue.append(move)