Skip to content

Commit

Permalink
fix gcode ref
Browse files Browse the repository at this point in the history
  • Loading branch information
bwnance committed Dec 21, 2023
1 parent 4d30922 commit b147871
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions klippy/klippy.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,11 @@ def wait_while(self, condition_cb):
waits until callback returns False
(or is interrupted, or printer shuts down)
"""
counter = self.gcode.get_interrupt_counter()
gcode = self.lookup_object("gcode")
counter = gcode.get_interrupt_counter()
eventtime = self.reactor.monotonic()
while condition_cb(eventtime):
if (
self.is_shutdown()
or counter != self.gcode.get_interrupt_counter()
):
if self.is_shutdown() or counter != gcode.get_interrupt_counter():
return
eventtime = self.reactor.pause(eventtime + 1.0)

Expand Down

0 comments on commit b147871

Please sign in to comment.