aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/mcu.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-11-17 17:24:03 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-11-18 14:04:09 -0500
commit9e1059afb46c9df439211d21590da987b32e2963 (patch)
treeefaede08f7dd8ade191cd7c4c4ddf0e7b5576086 /klippy/mcu.py
parent7ef8c0442a719ef80b9ef4109ab7e8fa57157854 (diff)
downloadkutter-9e1059afb46c9df439211d21590da987b32e2963.tar.gz
kutter-9e1059afb46c9df439211d21590da987b32e2963.tar.xz
kutter-9e1059afb46c9df439211d21590da987b32e2963.zip
homing: Create QueryEndstops class from gcode
Create the QueryEndstops in the gcode handler instead of in the kinematic classes. This simplifies the gcode handler as it can directly register its response callback. Also, store the stepper name in the stepper class. Also, propagate the print_time of the query request to the mcu_endstop class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r--klippy/mcu.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py
index de9518ac..df1bb3dc 100644
--- a/klippy/mcu.py
+++ b/klippy/mcu.py
@@ -140,10 +140,11 @@ class MCU_endstop:
if self._stepper.get_invert_dir():
return -pos
return pos
- def query_endstop(self):
+ def query_endstop(self, mcu_time):
+ clock = int(mcu_time * self._mcu_freq)
self._homing = False
self._min_query_time = time.time()
- self._next_query_clock = 0
+ self._next_query_clock = clock
def get_last_triggered(self):
return self._last_state.get('pin', self._invert) ^ self._invert