From 9e1059afb46c9df439211d21590da987b32e2963 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 17 Nov 2016 17:24:03 -0500 Subject: 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 --- klippy/mcu.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'klippy/mcu.py') 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 -- cgit v1.2.3-70-g09d2