aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/homing.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-12-08 12:42:12 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-12-09 17:09:51 -0500
commita6de1db94d108f401f7f3e67f735743106e16837 (patch)
tree8b26f59cc412e155b3d1d271a2413338ee7ff015 /klippy/homing.py
parented9d7e4fae6eb042f93504553c9445cb8d136c4e (diff)
downloadkutter-a6de1db94d108f401f7f3e67f735743106e16837.tar.gz
kutter-a6de1db94d108f401f7f3e67f735743106e16837.tar.xz
kutter-a6de1db94d108f401f7f3e67f735743106e16837.zip
gcode: Rework endstop query to use greenlets
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/homing.py')
-rw-r--r--klippy/homing.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/klippy/homing.py b/klippy/homing.py
index 384da3dd..b1126b57 100644
--- a/klippy/homing.py
+++ b/klippy/homing.py
@@ -90,40 +90,6 @@ class Homing:
def do_calc_position(self, callback):
self.toolhead.set_position(self.fill_coord(callback(self)))
-# Helper code for querying and reporting the status of the endstops
-class QueryEndstops:
- def __init__(self, print_time, respond_cb):
- self.print_time = print_time
- self.respond_cb = respond_cb
- self.endstops = []
- self.busy = []
- def set_steppers(self, steppers):
- for stepper in steppers:
- es = stepper.query_endstop(self.print_time)
- if es is None:
- continue
- self.endstops.append((stepper.name, es))
- self.busy.append((stepper.name, es))
- def check_busy(self, eventtime):
- # Check if all endstop queries have been received
- while self.busy:
- try:
- if self.busy[0][1].check_busy(eventtime):
- return True
- except mcu.error, e:
- raise EndstopError("Failed to query endstop %s: %s" % (
- self.busy[0][0], str(e)))
- self.busy.pop(0)
- # All responses received - report status
- msgs = []
- for name, es in self.endstops:
- msg = "open"
- if es.get_last_triggered():
- msg = "TRIGGERED"
- msgs.append("%s:%s" % (name, msg))
- self.respond_cb(" ".join(msgs))
- return False
-
class EndstopError(Exception):
pass